Hey ich hab folgendes Problem.
Wenn man den Befehl eingibt, wird man vom Server geschmissen und samp crasht.
Hier der Pawno ausschnitt
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "** You havent logged in yet !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Du bist gemutet!");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: (/ad)vertise [Text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "** Bitte versuch es nach %d Sekunden erneut !", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
SafeGivePlayerMoney(playerid, -50);
format(string, sizeof(string), "WERBUNG: %s, Kontakt %s (Nummer: %d)", result, sendername ,PlayerInfo[playerid][pPnumber]);
SendClientMessageToAll(COLOR_ORANGE,string);
GameTextForPlayer(playerid, "w~Preis:~g~$50", 4321,1);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
new y,m,d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (Advertisement): %s",d,m,y,h,mi,s, sendername, result);
ChatLog(string);
}
return 1;
}
edit: Das Spiel crasht aber nur bei diesem Command