04.03.2011, 23:08
Hi there. 
So i have this /jail command. It basically jails a player on a certain time with a certain reason. But as i /jail someone, the player just spawns.
Jail command:
JailTime:
Sorry for the command not being translated :\
Could someone please, please help me? I have been trying to fix this for 2 weeks now.

So i have this /jail command. It basically jails a player on a certain time with a certain reason. But as i /jail someone, the player just spawns.
Jail command:
Код:
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; }
Код:
forward JailTime(playerid); public JailTime(playerid) { new pID; if (JTime[pID] == 0) { TeamKill[pID] = 0; JTime[pID] = 0; SpawnPlayer(pID); KillTimer(JTTimer[pID]); TextDrawHideForPlayer(pID, JailTextDraw[pID]); return 1; } JTTimer[pID] = SetTimer("JailTime", 1000, 0); new string[50]; TextDrawShowForPlayer(pID, JailTextDraw[pID]); format(string, sizeof string, "~r~%i", JTime[pID]-1); TextDrawSetString(JailTextDraw[pID], string); JTime[pID]--; return 1; }
Could someone please, please help me? I have been trying to fix this for 2 weeks now.