not spawn Don't use command
#1

Please, The player without spawn , Don't use command and And you have to be logged in to spawn.

So = Login = 0, Don't spawn. - Login = 1, Yes Spawn.
So = Spawn = 0, Don't use command. - Spawn = 1, Yes use command.
Reply
#2

Use if and else statements and a enum for this
- https://sampwiki.blast.hk/wiki/Control_Structures#if
- https://sampwiki.blast.hk/wiki/Control_Structures#else
- https://sampwiki.blast.hk/wiki/Keywords:Initialisers#enum

Here, I did this for you.
This is the code with some missing things, you will have to read the links above and find out what is missing, this will help you out learning how to do this kind of functions:

pawn Код:
// On the top of your script

enum spawnInfo
{
    IsSpawned,
    // Something missing here
};
new sInfo[MAX_PLAYERS][spawnInfo];

// --------------------------------

public OnPlayerSpawn(playerid)
{
    if (sInfo[playerid][IsLogged] == 0)
    {
        TogglePlayerControllable(playerid, 1);
    }
        // Something missing here
    {
        sInfo[playerid][IsSpawned] = 1; // Something missing here
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    sInfo[playerid][IsSpawned] = ; // Something missing here
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (  ) // Something missing here
    {
        SendClientMessage(playerid, 0xFF0000FF, "[ERROR] You can not use any command if you are not spawned.");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)