18.03.2012, 07:58
(
Последний раз редактировалось doreto; 18.03.2012 в 07:59.
Причина: i forgot stock PlayerName
)
PHP код:
CMD:jail(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(!sscanf(params, "u", id))
{
new string[64];
format(string, sizeof(string), "You have been jailed by %s.", PlayerName(playerid));
SendClientMessage(id, 0xD8D8D8FF, string);
format(string, sizeof(string), "You jailed %s .", PlayerName(id));
SendClientMessage(playerid, 0xD8D8D8FF, string);
SetPlayerPos(id, 264.5442199707,77.155387878418,1001.0390625);
SetPlayerInterior(id, 6);
return true;
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /jail [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
PHP код:
CMD:unjail(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(!sscanf(params, "u", id))
{
new string[64];
format(string, sizeof(string), "You have been unjailed by %s.", PlayerName(playerid));
SendClientMessage(id, 0xD8D8D8FF, string);
format(string, sizeof(string), "You unjailed %s .", PlayerName(id));
SendClientMessage(playerid, 0xD8D8D8FF, string);
SetPlayerPos(id, 1552.1305,-1675.6511,16.1554);
SetPlayerInterior(id, 0);
return true;
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /unjail [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
EDIT:forgot stock PlayerName
PHP код:
stock PlayerName(playerid)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
return Name;
}