20.01.2013, 20:07
PHP код:
CMD:ajail(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 0)
{
new name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME],string[128],id,reason[64],time;
if(sscanf(params,"ds[64]",id,time,reason)) return SendClientMessage(playerid,GRAY,"CMD: /ajail <playerid> <minutes> <reason>");
GetPlayerName(playerid,name, sizeof(name));
GetPlayerName(id,name2, sizeof(name2));
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, GRAY,"CMD: Invalid playerid.");
format(string, sizeof(string), "Administrator %s admin jailed %s %s minutes for %s.", name,name2,time,reason);
SendClientMessageToAll(PINK,string);
SetPlayerPos(id,-1425.1499,1490.4562,1.8672);
} // Administrator Noles2197 admin jailed Noles2197 minutes for 60 dm."
return 1;
}
The time and reason seem to be getting mixed up and I think it has something to do with..
"if(sscanf(params,"ds[64]",id,time,reason)) return SendClientMessage(playerid,GRAY,"CMD: /ajail <playerid> <minutes> <reason>");"