12.02.2012, 16:48
How to make when a player leave the server with wanted next time when he login spawn him at jail?
new IsJailed = 0
public OnPlayerDisconnect(playerid)
{
if(GetPlayerWantedLevel(playerid) > 3)
{
IsJailed = 1;
//If a player logs off with a wanted level greater than 3. Then the IsJailed would be set to 1 or yes.
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsJailed == 1)
{
SetPlayerPos(playerid,You would put the jail coordinates here);
SetTimer("JailTime",60000,false); //If a player's variable IsJailed is set to 1 or yes then it will set a timer of 60 seconds.
}
}
forward JailTime(playerid);
public JailTime(playerid)
{
SetPlayerPos(playerid,you eould put the release coords here.);
IsJailed = 0; //After those sixty seconds are up. They will be released and heir IsJailed would be set to 0 or 'no'.
}
First you need a way of saving account stats.
Second, you can define variables. Example: pawn Код:
|