public OnPlayerEnterCheckpoint(playerid) { if(GetPlayerWantedLevel(playerid) >= 1) { SetTimer("prisoncell", 10000, true); SetPlayerWantedLevel(playerid, 0); SetPlayerInterior(playerid, 6); SetPlayerPos(playerid,263.9106,77.6354,1001.0391); }
public OnPlayerEnterCheckpoint(playerid)
{
if(GetPlayerWantedLevel(playerid) >= 1)
{
PrisonT[playerid] = SetTimerEx("prisoncell", 10000, false,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid,263.9106,77.6354,1001.0391);
}
}
forward prisoncell(playerid); // if you didnt already
public prisoncell(playerid)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,Float:x,Float:y,Float:z); // update to the location
KillTimer(PrisonT[playerid]);
return 1;
}
Hey there,
Basically I am looking for a bit of help with a timer. When somebody with a wanted star walks into my checkpoint it sends them to a cell. I only want them to be in that cell for 60 seconds and then it releases them and sends them to a different position. I'll show you what I have so far, and if anybody can complete it that'll be awesome. Код:
public OnPlayerEnterCheckpoint(playerid) { if(GetPlayerWantedLevel(playerid) >= 1) { SetTimer("prisoncell", 10000, true); SetPlayerWantedLevel(playerid, 0); SetPlayerInterior(playerid, 6); SetPlayerPos(playerid,263.9106,77.6354,1001.0391); } cheers team. |
public OnPlayerEnterCheckpoint(playerid) { if(GetPlayerWantedLevel(playerid) >= 1) { SetTimerEx("prisoncell", 60000, false,"i",playerid);//we need SetTimerEx SetPlayerWantedLevel(playerid, 0); SetPlayerInterior(playerid, 6); SetPlayerPos(playerid,263.9106,77.6354,1001.0391); }
forward prisoncell(playerid);
public prisoncell(playerid)
{
//SetPlayerPos and all that stuff.
return 1;
}