03.03.2011, 15:36
Hey guys.
Yea yea.. i'm annoying I know.
So i tried to make a /jail command. Ex: /jail [ID] [seconds] [reason]
Basically i failed.
Could someone suggest me a good /jail script or help me with my old one?
My old jail script:
So the problem with this one ^ is that it sometimes as i jail a player, he automaticaly gets released from it.
Code that lets the player out of the jail:
Cookie to anyone who helps me.
Yea yea.. i'm annoying I know.
So i tried to make a /jail command. Ex: /jail [ID] [seconds] [reason]
Basically i failed.
Could someone suggest me a good /jail script or help me with my old one?
My old jail script:
Код:
dcmd_jail(playerid,params[]) { new Reason[256], pID; if(Player[playerid][Admin] < 1){ SendClientMessage (playerid,COLOR_BRIGHTRED,"Tev nav autorizācijas lietot љo komandu."); return 1; } if(sscanf(params,"uds",pID,JTime[pID],Reason)){ return SendClientMessage(playerid,COLOR_BRIGHTRED,"Pielietojums: /jail [ID] [Laiks] [Iemesls]"); } if(!IsPlayerConnected(pID)) { return SendClientMessage(playerid,COLOR_BRIGHTRED,"Spēlētājs ar љādu ID nēeksistē."); } if(Player[playerid][Admin] < Player[pID][Admin]){ return SendClientMessage(playerid,COLOR_BRIGHTRED,"Tu nevari ielikt augstākas pakāpes adminu cietumā."); } if(TeamKill[pID] == 1) { return SendClientMessage(playerid,COLOR_BRIGHTRED,"Spēlētājs jau atrodas cietumā."); } new name[MAX_PLAYER_NAME], string[256]; GetPlayerName(pID,name,sizeof(name)); format(string,sizeof(string),"Admins ielika %s cietumā uz %d sekundēm. [Iemesls: %s]",name,JTime,Reason); SendClientMessageToAll(COLOR_WHITE,string); TeamKill[pID] = 1; JailTime(pID); SetPlayerPos(pID,-11.5327,2328.8679,24.1406); TextDrawShowForPlayer(pID, JailTextDraw[pID]); return 1; }
Code that lets the player out of the jail:
Код:
forward JailTime(playerid); public JailTime(playerid) { if (JTime[playerid] == 0) { TeamKill[playerid] = 0; JTime[playerid] = 0; SpawnPlayer(playerid); KillTimer(JTTimer[playerid]); TextDrawHideForPlayer(playerid, JailTextDraw[playerid]); return 1; } JTTimer[playerid] = SetTimer("JailTime", 1000, 0); new string[50]; TextDrawShowForPlayer(playerid, JailTextDraw[playerid]); format(string, sizeof string, "~r~%i", JTime[playerid]-1); TextDrawSetString(JailTextDraw[playerid], string); JTime[playerid]--; return 1; }