pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[300], idx;
cmd = strtok(cmdtext, idx);
dcmd(givecash, 8, cmdtext);
//jail
if(strcmp(cmdtext, "/ar", true) == 0)
{
new sendername[MAX_PLAYER_NAME];
new giveplayerid;
new giveplayer[MAX_PLAYER_NAME];
new string[256], tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ar [id]");
giveplayerid = strval(tmp);
new myskin = GetPlayerSkin(playerid);
if(myskin == 280)
{
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Officer %s(%i) Has jailed you for 2 minutes!", sendername, playerid);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
SetPlayerInterior(giveplayerid,3);
SetPlayerPos(giveplayerid,198.3797,160.8905,1003.0300);
SetPlayerFacingAngle(giveplayerid,177.0350);
GameTextForPlayer(playerid,"~r~Don't fight in Jail!",2500,3);
SetCameraBehindPlayer(giveplayerid);
SetTimer("ExitJail",120000,0);
format(string, sizeof(string), "You have jailed %s(%i)", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
GivePlayerMoney( playerid, 10000 );
}
else
{
format(string, sizeof(string), "SERVER: %d isn't connected", giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
else return SendClientMessage(playerid, COLOR_RED, "[!] You must be a cop!");
return 1;
}
return 0;//There has to be a return 0 before the end of your OnPlayerCommandText :)
}