new JailTime[MAX_PLAYERS];
SetTimer("JailTimer", 1000, true);
forward JailTimer();
public JailTimer()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(JailTime[i] > 0)
{
JailTime[i]--;
if(JailTime[i] == 0)
{
// release player from jail
}
}
}
}
}
JailTime[playerid] = 3600;
pawn Код:
pawn Код:
pawn Код:
pawn Код:
Save JailTime[playerid] with dini. |
Post the command you made. That could be inter-fearing with the script.
|
new AJailTime[MAX_PLAYERS]; forward AJailTimer();
SetTimer("AJailTimer", 1000, true);
new ajailtime; ajailtime = AJailTime[playerid]; dini_IntSet(bestand, "AJailTime", ajailtime);
public AJailTimer() { for(new i=0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(AJailTime[i] > 0) { AJailTime[i]--; if(AJailTime[i] == 0) { new name[MAX_PLAYER_NAME], str[256]; GetPlayerName(i, name, sizeof(name)); format(str, sizeof(str), "/eGamingRP/Users/%s.ini", name); dini_IntSet(str, "AJailed", 0); SetPlayerPos(i, 238.6917,139.2280,1003.0234); GameTextForPlayer(i, "~w~Ajail tijd ~r~verlopen", 3000, 1); SendClientMessage(i, COLOR_RED, "> Je bent uit de Admin Jail, gedraag je de volgende keer."); SendClientMessage(i, COLOR_DARKRED, "> LET OP: Te erg Non-RP zijn kan leiden tot een permanente Ban."); } } } } }
if(strcmp("/ajail", cmd, true) == 0) { if(dini_Int(bestand, "AdminLevel") > 0) { tmp = strtok(cmdtext,idx); if(!strlen(tmp) || strlen(tmp) > 5) { return SendClientMessage(playerid,COLOR_LIGHTRED,"[GEBRUIK]: /ajail [spelerid] [reden]"); } new id = strval(tmp); if(!IsPlayerConnected(id)) { SendClientMessage(playerid,COLOR_RED,"** De speler die u heeft geprobeerd te 'Admin Jailen' is niet te bereiken."); return 1; } gMessage = strrest(cmdtext,idx); GetPlayerName(id,iName,sizeof(iName)); SendClientMessage(id,COLOR_DARKRED,"[ ! ] Je bent Admin jailed voor 60 minuten."); if(strlen(gMessage) > 0) { format(Message,sizeof(Message),"Reden: %s",gMessage); SendClientMessage(id,COLOR_DARKRED,Message); } format(Message,sizeof(Message),"[ %s(%d) is Admin jailed. Duur: 60 minuten. Reden: %s ]",iName,id, gMessage); SendClientMessageToAll(COLOR_DARKRED,Message); SetPlayerPos(id, 1388.0905,-1206.4396,202.4453); AJailTime[playerid] = 3600; dini_IntSet(bestand, "AJailed", 1); return 1; } else { SendClientMessage(playerid, COLOR_RED, "** Deze commando kunt u (nog) niet gebruiken. [AdmCmd]"); return 1; } }
dini_IntSet(bestand, "AJailTime", 0);
AJailTime[id] = 3600;
format(str, sizeof(str), "/eGamingRP/Users/%s.ini", iName);
dini_IntSet(str, "AJailed", 1);