Hey,
ich habe folgendes Gutscheinsystem auf Ini Basis.
Doch ich habe da fehler...
ocmd:gutschein(playerid, params[])
{
if(!params[0]) return SendClientMessage(playerid, 0xFF0000FF, "/gutschein [Code]");
new code[40];
format(code, sizeof(code), "/codes/%s.txt", params);
if(!fexist(code)) return SendClientMessage(playerid, 0xFF0000FF, "Code existiert nicht.");
new typ = dini_Int(code, typ);
if(typ == 1)
{
GivePlayerMoney(playerid, wert);
SendClientMessage(playerid,-1,"Code eingelöst: %i$ bekommen.",wert);
fremove(code);
}
if(typ == 2)
{
PlayerInfo[playerid][pExp] = wert;
SendClientMessage(playerid,-1,"Code eingelöst: %i Respektpunkte bekommen.",wert);
fremove(code);
}
if(typ == 3)
{
PlayerInfo[playerid][pDonateRank] = wert;
SendClientMessage(playerid,-1,"Code eingelöst: Du hast Premium Level %i bekommen.",wert);
fremove(code);
}
if(typ == 4)
{
PlayerInfo[playerid][pAllowNeon] = 1;
SendClientMessage(playerid,-1,"Code eingelöst: Du hast einen Neon Gutschein eingelöst.");
SendClientMessage(playerid,-1,"Fahre zum NeonShop um dir Neon an dein Auto zu bauen.");
//ShowPlayerDialog(playerid, DIALOG_GUTSCHEINCARTAKE, DIALOG_STYLE_LIST, "Autoauswahl - Gutscheinsystem","Sultan\nInfernus\nTurismo\nCheetah\nPremier\nBanshee\nZR-350\nComet\nBullet\nJester\n","Select", "Cancel");
}
return 1;
}
ocmd:creategutschein(playerid, params[])
{
new typ[40], typid, wert;
if(PlayerInfo[playerid][pAdmin] == 5)
{
if(!sscanf(params,"ii",typid,wert))return SendClientMessage(playerid, 0xFF0000FF, "/createcode [Typ] [Wert]");
if(typ < 1 || typ > 4)return SendClientMessage(playerid,-1,"Bitte wähle einen Typ aus von 1-4");
if(wert < 1 || wert > 1000000) return SendClientMessage(playerid,-1,"Wert bitte nur von 1 - 1Mio.");
SendClientMessage(playerid, 0xFF0000FF, "1 = Geld | 2 = Respektpunkte | 3 = Premium | 4 = UBB Fahrzeug");
new code[40], str[145];
format(code, sizeof(code), "%04d-%04d-%04d-%04d", random(10000), random(10000), random(10000), random(10000));
format(str, sizeof(str), "Gutscheincode : %s",code);
SendClientMessage(playerid,ROT,str);
format(code, sizeof(code), "/codes/%s.txt", code);
format(typ, sizeof(code), "%s", typid);
dini_Create(code);
dini_IntSet(code, typ, wert);
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Du hast kein Adminlevel 7");
}
return 1;
}
C:\Users\Patrick\Desktop\IRP-City\gamemodes\(59312) : error 029: invalid expression, assumed zero
C:\Users\Patrick\Desktop\IRP-City\gamemodes\(69653) : error 035: argument type mismatch (argument 2)
C:\Users\Patrick\Desktop\IRP-City\gamemodes\(69656) : error 017: undefined symbol "wert"
C:\Users\Patrick\Desktop\IRP-City\gamemodes\(69657) : error 017: undefined symbol "wert"
C:\Users\Patrick\Desktop\IRP-City\gamemodes\(69663) : error 017: undefined symbol "wert"
C:\Users\Patrick\Desktop\IRP-City\gamemodes\(69664) : error 017: undefined symbol "wert"
C:\Users\Patrick\Desktop\IRP-City\gamemodes\(69669) : error 017: undefined symbol "wert"
C:\Users\Patrick\Desktop\IRP-City\gamemodes\(69670) : error 017: undefined symbol "wert"
C:\Users\Patrick\Desktop\IRP-City\gamemodes\(69690) : error 033: array must be indexed (variable "typ")
C:\Users\Patrick\Desktop\IRP-City\gamemodes\(72671) : warning 203: symbol is never used: "M_OnPlayerCommandText"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
9 Errors.
Alles anzeigen
Jetzt abgesehen von den Fehlern.
Würde es so funktionieren?
if(dialogid == DIALOG_GUTSCHEINCARTAKE)
{
if(listitem == 0)//Sultan 560
{
}
if(listitem == 1) //Infernus 411
{
}
if(listitem == 2)//Turismo 451
{
}
if(listitem == 3)//Cheetah 415
{
}
if(listitem == 4)//Premiuer 426
{
}
if(listitem == 5)//Banshee 429
{
}
if(listitem == 6)//Zr350 477
{
}
if(listitem == 7)//Comet 480
{
}
if(listitem == 8)//Bullet 541
{
}
if(listitem == 9)//jester 559
{
}
}
und das Car Enum, da das Neon gespeichert werden soll.
enum dtc_PlayerCar
{
CarId,
CarOwner[MAX_PLAYER_NAME],
CarModel,
Float:CarPos_x,
Float:CarPos_y,
Float:CarPos_z,
Float:CarRotate,
CarNitro,
CarHyd,
CarWheel,
CarAusp,
CarSideL,
CarSideR,
CarFB,
CarRB,
CarSpoiler,
CarRoof,
CarHood,
CarVents,
CarLamps,
CarPJ,
CarC1,
CarC2,
CarPreis,
CarArrest,
Plate[15],
};
new PlayerCar[MAX_PLAYERS][MaxVeh][dtc_PlayerCar];
Ich bedanke mich bei allen die versuchen zu helfen...