04.04.2009, 15:53
When I try to compile this code on my GM , pawno crashes -.-, can you see the problem ?
pawn Код:
if(strcmp(cmd, "/fine", true) == 0) {
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [Player ID] [Amount]");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [Player ID] [Amount]");
return 1;
}
if(gteam[playerid]==Team_LSPD || gteam[playerid] ==Team_SFPD || gteam[playerid] ==Team_SWAT || gteam[playerid] ==Team_SASP || gteam[playerid] ==Team_SWAT || gteam[playerid] == Team_DCPT || gteam[playerid] == Team_DCP || gteam[playerid]==Team_L1A){
if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
GivePlayerMoney(playerid, 2000); //2000$ goto the stealer
GivePlayerMoney(giveplayerid, (-2000)); //-2000$ from the loser :P
format(string, sizeof(string), "You have fined %s (ID:%d) $%d.", giveplayer,giveplayerid, moneys);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "You have been fined $%d by Officer %s.", moneys, sendername);
format(string, sizeof(string), "(INFO) Unit %d has issued %s (ID:%d) a $%d fine.",playerid, giveplayer, giveplayerid, moneys);
SendMessageToLaw(string);
} else {
format(string, sizeof(string), "ID %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}
}
return 1;
}