Hi Leute, ich bin noch sehr unerfahren in Pawno deswegen bitte nicht so hart rannehmen wenn ich was nicht verstehe
Also folgendes Problem:
Ich habe einen Befehl gescriptet, aber wenn ich compilen will dann stürzt Pawno ab, woran könnte es liegen?
if(strcmp(cmd, "/kaufescheine", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerMoney(playerid) < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Du hast nicht genug Geld !");
return 1;
}
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /kaufescheine [Schein]");
SendClientMessage(playerid, COLOR_WHITE, "Verfügbar: Flying, Sailing, Fishing, Weapon, Motorrad, LKW, Perso.");
return 1;
}
if (strcmp(x_nr,"Flying", true) == 0)
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /Kaufescheine [Schein]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "* Du kaufst einen Flugschein.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - 1000);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[giveplayerid][pFlyLic] = 1;
return 1;
}
}
else if (strcmp(x_nr,"Sailing", true) == 0)
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /Kaufescheine [Schein]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "* Du kaufst einen Bootsschein.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - 1000);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[giveplayerid][pBoatLic] = 1;
return 1;
}
}
else if (strcmp(x_nr,"Fishing", true) == 0)
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /Kaufescheine [Schein]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "* Du kaufst einen Angelschein.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - 1000);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[giveplayerid][pFishLic] = 1;
return 1;
}
}
else if (strcmp(x_nr,"Weapon", true) == 0)
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /Kaufescheine [Schein]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "* Du kaufst einen Waffenschein.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - 1000);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[giveplayerid][pGunLic] = 1;
return 1;
}
}
else if (strcmp(x_nr,"Motorrad", true) == 0)
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /Kaufescheine [Schein]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "* Du kaufst einen Motorradschein.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - 1000);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[giveplayerid][pMotoLic] = 1;
return 1;
}
}
else if (strcmp(x_nr,"LKW", true) == 0)
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /Kaufescheine [Schein]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "* Du kaufst einen LKW-Schein.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - 1000);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[giveplayerid][pLKWLic] = 1;
return 1;
}
}
else if (strcmp(x_nr,"Perso", true) == 0)
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /Kaufescheine [Schein]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "* Du kaufst einen Personalausweis.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - 1000);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[giveplayerid][pOwnPerso] = 1;
return 1;
}
}
if(GetPlayerMoney(playerid) < 1000)
{
SendClientMessage(playerid, COLOR_GREY, " Du hast zuwenig Geld dabei!");
return 1;
}
}