not spawn Don't use command
#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


Messages In This Thread
not spawn Don't use command - by Harward - 19.09.2015, 13:39
Re: not spawn Don't use command - by Andre02 - 19.09.2015, 14:13

Forum Jump:


Users browsing this thread: 1 Guest(s)