OnPlayerSpawn problem
#1

Well i added
pawn Код:
if(Logged[playerid] == 0) return SendClientMessage(playerid,red,"ERROR: You must log in before spawning.");
under onplayerspawn but when i press spawn, i spawn at lv airport with no cash or anything and it says you must log in before spawning on my chat. How can i make it shows the message "ERROR: You must log in before spawning." and player doesnt spawn and they could spawn until they log in
Reply
#2

Quote:
Originally Posted by Tanush123
Посмотреть сообщение
Well i added
pawn Код:
if(Logged[playerid] == 0) return SendClientMessage(playerid,red,"ERROR: You must log in before spawning.");
under onplayerspawn but when i press spawn, i spawn at lv airport with no cash or anything and it says you must log in before spawning on my chat. How can i make it shows the message "ERROR: You must log in before spawning." and player doesnt spawn and they could spawn until they log in
We need more code. also search through your gm for Logged[playerid] and see if it's set to smthn not like 0
Reply
#3

I have Logged[playerid] = 1; for when the player logs in. And i just want to know how to make the message show if the player doesnt log and and press spawn. when i press spawn while im not logged in i just spawn in the game and i want that to stop until the player log in so he could spawn
Reply
#4

Try adding it under
Код:
public OnPlayerRequestSpawn(playerid)
{
	return 1;
}
Reply
#5

Quote:
Originally Posted by .:Kaos:.
Посмотреть сообщение
Try adding it under
Код:
public OnPlayerRequestSpawn(playerid)
{
	return 1;
}
Still not fixed D:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(Logged[playerid] == 0)
    {
    SendClientMessage(playerid,red,"ERROR: You must log in before spawning.");
    }
    return 1;
}
Reply
#6

Try using this
Код:
public OnPlayerRequestSpawn(playerid)
{
    if(Logged[playerid] == 0)
    {
        SendClientMessage(playerid,red,"ERROR: You must log in before spawning.");
        return 0; //Making sure the player won't spawn.
    }
    //Player is logged, so they sawn.
    return 1;
}
You need to return 0 so the player can't spawn.
Reply
#7

EDIT: I fixed it thanks dude but dude, when somebody logs in sometimes they get random score, admin level and etc can you help me please?? i use mysql
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)