14.11.2015, 20:04
The problem is when i get jailed like for 1min (just an example) and use /unjail i get unjailed but when the 1min pass i get unjail again -.- any solution?! idk why it is bugged
these are the both cmds : http://pastebin.com/JXFzqScC too
another thing,i wanna make my /v cmd when someone doesn't type the color it spawns with random color
Quote:
CMD:jail(playerid, params[]) { new string[SOS], toplayerid, time, reason[SOS]; if(pInfo[playerid][Admin]<=0) return SendClientMessage(playerid, RED, "ERROR: You Aren't High Level Enough To Use This Command"); if(sscanf(params, "uis", toplayerid, time, reason)) return SendClientMessage(playerid, RED, "ERROR: /jail [ID] [Time] [Reason]"); if(!IsPlayerConnected(toplayerid)) return SendClientMessage(playerid, RED, "The player is not connected"); SetPlayerInterior(toplayerid, 6); SetPlayerPos(toplayerid, 264.6707,77.4835,1001.0391); SetPlayerVirtualWorld(toplayerid, 97); GameTextForPlayer(toplayerid, "~r~JAILED", 60000*time, 3); format(string, SOS, "%s has been jailed for %i minute(s) by Administrator %s Reason: %s", pInfo[toplayerid][Name], time, pInfo[playerid][Name], reason); SendClientMessageToAll(RED, string); SetTimerEx("jail", 60000*time, false, "i", toplayerid); pInfo[toplayerid][Jailed] = 1; return 1; } forward jail(toplayerid); public jail(toplayerid) { SpawnPlayer(toplayerid); SetPlayerVirtualWorld(toplayerid, 0); SetPlayerInterior(toplayerid, 0); SendClientMessage(toplayerid, GREEN, "You have been unjailed!"); pInfo[toplayerid][Jailed] = 0; return 1; } |
Quote:
CMD:unjail(playerid, params[]) { new string[SOS], toplayerid; if(pInfo[playerid][Admin]<=0) return SendClientMessage(playerid, RED, "ERROR: You Aren't High Level Enough To Use This Command"); if(sscanf(params, "u", toplayerid)) return SendClientMessage(playerid, RED, "ERROR: /unjail [ID]"); if(!IsPlayerConnected(toplayerid)) return SendClientMessage(playerid, RED, "ERROR: The player isn't connected"); if(pInfo[toplayerid][Jailed] == 0) return SendClientMessage(playerid, RED, "ERROR: The Player isn't jailed"); if(pInfo[toplayerid][Jailed] == 1) { format(string, SOS, "You have unjailed %s", pInfo[toplayerid][Name]); SendClientMessage(playerid, COLOR_WHITE, string); GameTextForPlayer(toplayerid, "~r~UNJAILED", 3000, 3); KillTimer(jail(toplayerid)); pInfo[toplayerid][Jailed]=0; } return 1; } |
another thing,i wanna make my /v cmd when someone doesn't type the color it spawns with random color
Quote:
CMD:vehicle(playerid, params[]) { new Float ![]() new vehicleid, color1, color2; if(sscanf(params, "iii", vehicleid, color1, color2)) return SendClientMessage(playerid, RED, "ERROR: /v [Vehicle ID] [Color1] [Color2]"); if(vehicleid > 611 || vehicleid < 400) return SendClientMessage (playerid, RED, "ERROR: Vehcile ID Must Be Between 400 & 611"); GetPlayerPos(playerid, x, y ,z); GetPlayerFacingAngle(playerid, a); vehicleid = CreateVehicle(vehicleid, x, y, z, a, color1, color2, 60, 0); PutPlayerInVehicle(playerid, vehicleid, 0); return 1; } |