Suspect Problem
#1

How to make when a player leave the server with wanted next time when he login spawn him at jail?
Reply
#2

First you need a way of saving account stats.

Second, you can define variables.

Example:
pawn Код:
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'.
}
Reply
#3

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
First you need a way of saving account stats.

Second, you can define variables.

Example:
pawn Код:
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'.
}
You need to add [MAX_PLAYERS] to that, and use isJailed[playerid] or it will be a global variable (aka for everyone).
Reply
#4

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
You need to add [MAX_PLAYERS] to that, and use isJailed[playerid] or it will be a global variable (aka for everyone).
Thank you for correcting me on that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)