CMD:arrest(playerid, params[])
{
new id, time[120], reason[128];
if(sscanf(params,"uds[128]", id, time, reason)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Use: /arrest [ID] [Time] [Reason]");
{
if(pInfo[playerid][FactionID] == 1)
{
if(IsPlayerInRangeOfPoint(id, 5, 264.0432,86.6674,1001.0391)) // cela 1
{
new name[MAX_PLAYER_NAME], str[256], str2[256];
GetPlayerName(id, name, sizeof(name));
format(str, sizeof(str), "you have been arrested for %d minutes, by the reason: %s", time, reason);
SendClientMessage(id, COLOR_RED, str);
format(str2, sizeof(str2), "You have arrested the player: %s for %d minutes, by the reason: %s", name, time, reason);
SendClientMessage(id, COLOR_RED, str2);
pInfo[id][Njailed] = 1;
LSPDTIMERJAIL[playerid] = SetTimerEx("LSPDTIMERCELL", 1000, false, "d", playerid);
}
else if(IsPlayerInRangeOfPoint(id, 5, 263.9735,82.0618,1001.0391)) // cela 2
{
new name[MAX_PLAYER_NAME], str[256], str2[256];
GetPlayerName(id, name, sizeof(name));
format(str, sizeof(str), "you have been arrested for %d minutes, by the reason: %s", time, reason);
SendClientMessage(id, COLOR_RED, str);
format(str2, sizeof(str2), "You have arrested the player: %s for %d minutes, by the reason: %s", name, time, reason);
SendClientMessage(playerid, COLOR_RED, str2);
pInfo[id][Njailed] = 1;
LSPDTIMERJAIL[playerid] = SetTimerEx("LSPDTIMERCELL2", 1000, false, "d", playerid);
}
}
}
return 1;
}
forward LSPDTIMERCELL(playerid);
forward LSPDTIMERCELL2(playerid);
public LSPDTIMERCELL(playerid)
{
new lspdtimeval = time
lspdtimeval--;
}
time[120]
time
SetTimerEx("LSPDTIMERCELL", 1000, false, "d", playerid);
SetTimerEx("LSPDTIMERCELL", 1000, false, "d", playerid);
SetTimerEx("LSPDTIMERCELL", time, false, "d", playerid);
SetTimerEx("LSPDTIMERCELL", time, false, "d", playerid);
and how can i define 60000 milliseconds as 1 minute, since players will use minutes and not miliseconds?
|