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.");
}
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.");
}
stock PlayerName(playerid)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
return Name;
}
where do i put this:
stock PlayerName(playerid) { new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); return Name; } lol |
CMD:jail(playerid,params[]) { if(PInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid)) { new id; new jailedname[MAX_PLAYER_NAME]; new adminname[MAX_PLAYER_NAME]; if(sscanf(params,"u",id))return SendClientMessage(playerid,red,"Useage: /jail <playerid>"); if(IsPlayerConnected(id)) { GetPlayerName(id,jailedname,sizeof(jailedname)); GetPlayerName(playerid,adminname,sizeof(adminname)); new string[256]; format(string,sizeof(string),"Administrator \"%s\" Has Jailed You",adminname); SendClientMessage(id,blue,string); format(string,sizeof(string),"You Have Jailed \"%s\"",jailedname); SendClientMessage(playerid,blue,string); SetPlayerPos(id, 264.5442199707,77.155387878418,1001.0390625); return SetPlayerInterior(id, 6); } else return SendClientMessage(playerid,red,"ERROR: Player Is Not connected"); } else return SendClientMessage(playerid,red,"ERROR: You are not a admin to use this command"); } CMD:unjail(playerid,params[]) { if(PInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid)) { new id; new unjailedname[MAX_PLAYER_NAME]; new adminname[MAX_PLAYER_NAME]; if(sscanf(params,"u",id))return SendClientMessage(playerid,red,"Useage: /unjail <playerid>"); if(IsPlayerConnected(id)) { GetPlayerName(id,jailedname,sizeof(jailedname)); GetPlayerName(playerid,adminname,sizeof(adminname)); new string[256]; format(string,sizeof(string),"Administrator \"%s\" Has UnJailed You",adminname); SendClientMessage(id,blue,string); format(string,sizeof(string),"You Have Jailed \"%s\"",unjailedname); SendClientMessage(playerid,blue,string); return SpawnPlayer(id); } else return SendClientMessage(playerid,red,"ERROR: Player Is Not connected"); } else return SendClientMessage(playerid,red,"ERROR: You are not a admin to use this command"); }
CMD:jail(playerid, params[]) { new PID; if(IsPlayerConnected(PID)) { if(!IsPlayerAdmin(playerid)) { if(!sscanf(params, "u", PID)) { new string[64]; format(string, sizeof(string), "You have been jailed by %s.", PlayerName(playerid)); SendClientMessage(PID, 0xD8D8D8FF, string); format(string, sizeof(string), "You jailed %s .", PlayerName(PID)); SendClientMessage(playerid, 0xD8D8D8FF, string); SetPlayerPos(PID, 264.5442199707,77.155387878418,1001.0390625); SetPlayerInterior(PID, 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."); } CMD:unjail(playerid, params[]) { new PID; if(IsPlayerConnected(PID)) { if(!IsPlayerAdmin(playerid)) { if(!sscanf(params, "u", PID)) { new string[64]; format(string, sizeof(string), "You have been unjailed by %s.", PlayerName(playerid)); SendClientMessage(PID, 0xD8D8D8FF, string); format(string, sizeof(string), "You unjailed %s .", PlayerName(PID)); SendClientMessage(playerid, 0xD8D8D8FF, string); SetPlayerPos(PID, 1552.1305,-1675.6511,16.1554); SetPlayerInterior(PID, 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."); } stock PlayerName(playerid) { new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); return Name; }
else return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command.");