OnPlayerSpawn problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerSpawn problem (
/showthread.php?tid=292346)
OnPlayerSpawn problem -
Tanush123 - 23.10.2011
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
Re: OnPlayerSpawn problem -
Cameltoe - 23.10.2011
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
Re: OnPlayerSpawn problem -
Tanush123 - 23.10.2011
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
Re: OnPlayerSpawn problem -
.:Kaos:. - 23.10.2011
Try adding it under
Код:
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
Re: OnPlayerSpawn problem -
Tanush123 - 23.10.2011
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;
}
Re: OnPlayerSpawn problem -
.:Kaos:. - 23.10.2011
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.
Re: OnPlayerSpawn problem -
Tanush123 - 23.10.2011
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