08.05.2009, 17:55
Hey guys, I need help with this /ajail command - I want it so that I can add a reason instead of just putting them in /ajail and also so that everyone on the server can see that the person has been /ajailed and the reason why
Many thanks,
Sam.
Код:
if(strcmp(cmd, "/ajail", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /ajail [playerid] [minutes]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 2)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "You jailed %s.", GetPlayerNameEx(playa));
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string);
format(string, sizeof(string), "You where jailed by %s for %d minutes.", GetPlayerNameEx(playerid),money);
SendClientMessage(playa, COLOR_LIGHTYELLOW2, string);
ResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 6);
SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
SetPlayerVirtualWorld(playerid,2);
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Your not an administrator.");
}
}
return 1;
}
Sam.

