Two questions
#1

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
Reply
#2

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.
Reply
#3

I know... But I don't want the player to be kicked, but to be at the spawn place..
Reply
#4

pawn Код:
PlayerPlaySound(playerid, 1184, 0.0,0.0,0.0);
Use this to stop the music
Reply
#5

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(logged[playerid] == 0)
    {
        SendClientMessage(playerid,COLOR_RED,"You must login before spawning!");
        return 0;
    }
    else return 1;
}
Reply
#6

Your login/register system, does it use dialogs?
Reply
#7

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.
Reply
#8

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;
}
Reply
#9

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.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)