HELP :/
#1

Anyone knows how to make for players which aren't spaned or them they can't use commands? If so please give me the code since im looking everywhere but can't find.

thnx in advance migu3x.
Reply
#2

Sorry, could you explain in more detail, I'm not quite understanding.
Reply
#3

When player isn't spawned and does.. /sync or /kill tell them, you cant use while not spawned
Reply
#4

pawn Код:
new bool:spawned[MAX_PLAYERS]=false;

OnPlayerSpawn(playerid..)
{
    spawned[playerid]=true;
}

OnPlayerCommandText(playerid.....)
{
    if(spawned[playerid]==true){

        //All your commands

    }
    else SendClientMessage(playerid, 0xFFFFFF, "You have to spawn to use any commands.");
}
Reply
#5

Here is an example...

First, Create a New Spawned like this:

pawn Код:
new bool:Spawned[MAX_PLAYERS];
Then on the request class AND OnPlayerConnect (as i understanded you , you meant that if he didnt choose a skin, he cant do a command)

pawn Код:
Spawned[playerid] = 0;
After that, in your OnPlayerSpawn, Put this

pawn Код:
Spawned[playerid] = 1;
pawn Код:
if(Spawned[playerid] == 0)
// Your code if he is not spawned
And to check if he is spawned:

pawn Код:
if(Spawned[playerid] == 1)
//Your code
Hope i helped.

EDIT: when i was typing the message the poster above me answered -_-
Reply
#6

DrDoom your methods appear outdated, I'm going to assume you are going to use a command processor like zcmd or similar.

pawn Код:
new bool:spawned[MAX_PLAYERS] = false;

OnPlayerSpawn(playerid..)
{
    spawned[playerid]=true;
}

OnPlayerCommandPerformed(playerid.....)
{
    if(spawned[playerid] == false) return SendClientMessage(playerid, -1, "You need to login/spawn before you can use commands.");;
    return1;
}
Something like that would be more efficient.
Reply
#7

Quote:
Originally Posted by Boooth
Посмотреть сообщение
DrDoom your methods appear outdated, I'm going to assume you are going to use a command processor like zcmd or similar.
Obviously I use zcmd myself, but I don't know if he does, hence I made it in the default mode and he can change it himself.
Reply
#8

where it sas your commands, what do i put? im using zcmd
Reply
#9

Quote:
Originally Posted by MiGu3X
Посмотреть сообщение
where it sas your commands, what do i put? im using zcmd
Read my method, i said

pawn Код:
if(Spawned[playerid] == 0)
// Your code if he is not spawned
And to check if he is spawned:

pawn Код:
if(Spawned[playerid] == 1) // if he is spawned
//Your code
Reply
#10

where do I put the if statements?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)