Need help with /jail command (Very Urgent)
#3

CMD:jail(playerid,params[])
{
new zstring[60];
new id,time,reason[100],aPlayerName[MAX_PLAYER_NAME],GPlayerName[MAX_PLAYER_NAME];//id = the targetid, time = the jailing time, reason[100]= the reason string in this tutorial i think you know about strings,playername and Gplayername for the jailing names ill explain later
if(sscanf(params,"dds",id,time,reason)) return SendClientMessage(playerid, color, "USAGE: /jail <playerid> <time> <reason>");// this is sscanf routine , d=integer and s= string
if(Jailed[id] == 1) return SendClientMessage(playerid, color, "ERROR: Player is already jailed.");// 1 jailed 0 is not jailed
GetPlayerName(id, aPlayerName, sizeof(aPlayerName));// the jailed person id
GetPlayerName(playerid, GPlayerName, sizeof(GPlayerName));// the admin id
format(szString, sizeof(szString), "AdmSys-: %s (ID:%d) has been jailed for %d minutes; Reason: %s", aPlayerName, id, time, reason);
SendClientMessageToAll(color, szString);//%s = name . %d = number
SetPlayerInterior(id, 3);//sets player interior
SetPlayerVirtualWorld(id, 10);//sets player vw
SetPlayerFacingAngle(id, 360.0);//player angle
SetPlayerPos(id, 197.5662, 175.4800, 1004.0);//player pos
SetPlayerHealth(id, 9999999999.0);//player cannot be killed
ResetPlayerWeapons(id);//resets his weapons
JailTimer[id] = SetTimerEx("Unjail",time*60000, false, "i", id);//jail timer
return 1;
}
Reply


Messages In This Thread
Need help with /jail command (Very Urgent) - by Goldino - 02.02.2013, 13:07
Re: Need help with /jail command (Very Urgent) - by Naruto_Emilio - 02.02.2013, 13:14
Re: Need help with /jail command (Very Urgent) - by Rapgangsta - 02.02.2013, 13:17
Re: Need help with /jail command (Very Urgent) - by Goldino - 02.02.2013, 13:19
Re: Need help with /jail command (Very Urgent) - by [swat]dragon - 02.02.2013, 13:27
Re: Need help with /jail command (Very Urgent) - by Goldino - 02.02.2013, 13:29
Re: Need help with /jail command (Very Urgent) - by [swat]dragon - 02.02.2013, 13:38
Re: Need help with /jail command (Very Urgent) - by Goldino - 02.02.2013, 14:31

Forum Jump:


Users browsing this thread: 1 Guest(s)