Two questions - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Two questions (
/showthread.php?tid=159704)
Two questions -
[DK]JaloNik - 14.07.2010
Hey guys!
Emh, two fast questions,
How do I stop a player for spawning without logging in?
I use this:
pawn Код:
public OnPlayerSpawn(playerid)
{
if(logged[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED,"You must login before spawning!");
}
if(logged[playerid] == 1)
{.......
But that only sends a message..
And, how do I stop the PlayerPlaySound() on the OnPlayerSpawn?
Thank you!
/JaloNik
Re: Two questions -
bigcomfycouch - 14.07.2010
pawn Код:
if(logged[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED,"You must login before spawning!");
Kick(playerid);
return 1;
}
also, the sound is a timer in the godfather. i forget the name.
Re: Two questions -
[DK]JaloNik - 14.07.2010
I know... But I don't want the player to be kicked, but to be at the spawn place..
Re: Two questions -
Jakku - 14.07.2010
pawn Код:
PlayerPlaySound(playerid, 1184, 0.0,0.0,0.0);
Use this to stop the music
Re: Two questions -
[XST]O_x - 14.07.2010
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(logged[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED,"You must login before spawning!");
return 0;
}
else return 1;
}
Re: Two questions -
oliverrud - 14.07.2010
Your login/register system, does it use dialogs?
Re: Two questions -
ikey07 - 14.07.2010
Quote:
Originally Posted by [DK]JaloNik
I know... But I don't want the player to be kicked, but to be at the spawn place..
|
pawn Код:
if(logged[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED,"You must login before spawning!");
SetPlayerPos(playerid,YourXSpawnplace,YourYSpawnplace,YourZSpawnplace);
return 1;
}
But First spawn you need to make anyway, if you want that player can do something.
Re: Two questions -
[DK]JaloNik - 14.07.2010
Quote:
Originally Posted by Jakku
pawn Код:
PlayerPlaySound(playerid, 1184, 0.0,0.0,0.0);
Use this to stop the music
|
Doesn't work...
Quote:
Originally Posted by [XST]O_x
pawn Код:
public OnPlayerRequestSpawn(playerid) { if(logged[playerid] == 0) { SendClientMessage(playerid,COLOR_RED,"You must login before spawning!"); return 0; } else return 1; }
|
This was what I wanted, just had to return!
Quote:
Originally Posted by ikey07
pawn Код:
if(logged[playerid] == 0) { SendClientMessage(playerid,COLOR_RED,"You must login before spawning!"); SetPlayerPos(playerid,YourXSpawnplace,YourYSpawnplace,YourZSpawnplace); return 1; }
But First spawn you need to make anyway, if you want that player can do something.
|
What do you mean with that? Ofc I got a spawn place..
pawn Код:
public OnPlayerSpawn(playerid)
{
if(logged[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED,"You must login before spawning!");
}
if(logged[playerid] == 1)
{
if(OnPlayerLoginSpawn[playerid] == 1)
{
SetPlayerPos(playerid,-2501.2983,2319.1453,4.9844);
PlayerPlaySound(playerid, 1184, 0.0,0.0,0.0); // This should stop my music, but doesn't...
}
if(OnPlayerDeathSpawn[playerid] == 1)
{
SendClientMessage(playerid,COLOR_RED,"You wake up on the hosital, forgot everything what happen the last 30 minitues.");
SendClientMessage(playerid,COLOR_RED,"You've been forced for $500 in Medical Bills.");
SetPlayerPos(playerid,-2492.1462,2363.3826,10.2732);
GivePlayerMoney(playerid,-500);
}
}
return 1;
}
Re: Two questions -
oliverrud - 14.07.2010
If you got a dialog system then just OnPlayerConnect
Check if the player has a account or not then show dialogs according to whether he have a account or not.
Re: Two questions -
[DK]JaloNik - 14.07.2010
Quote:
Originally Posted by oliverrud
If you got a dialog system then just OnPlayerConnect
Check if the player has a account or not then show dialogs according to whether he have a account or not.
|
Okay, I'm not using Dialog,m but I might soon change.