SA-MP Forums Archive
Disable player spawn button - 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: Disable player spawn button (/showthread.php?tid=348488)



Disable player spawn button - MarinacMrcina - 05.06.2012

I want to know how to disable the "Spawn" button when the player is watching the tutorial.

Код:
if(PInfo[playerid][Tutorial]==0)



Re: Disable player spawn button - milanosie - 05.06.2012

TogglePlayerSpectating(playerid, 1);


At the end of the tut, TogglePlayerSpectating(playerid, 0);


Re: Disable player spawn button - mahdi499 - 05.06.2012

If(PInfo[playerid][Tutorial]==0)
{
TogglePlayerSpectating(playerid, 1);
}
else if(pInfo[playerid][Tutorial]==1)
{
TogglePlayerSpectating(playeridid, 0);
}


Re: Disable player spawn button - MarinacMrcina - 05.06.2012

And how can I spawn the player automaticly so he doesn't need to click the "Spawn" button?


Re: Disable player spawn button - spedico - 05.06.2012

SpawnPlayer(playerid);


Re: Disable player spawn button - MarinacMrcina - 05.06.2012

Quote:
Originally Posted by spedico
Посмотреть сообщение
SpawnPlayer(playerid);
It only shows the 3 buttons down and does't spawn the player

pawn Код:
stock Login(playerid,key[])
{
    new file[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(file,sizeof(file),"/users/%s.txt",name);
    if(!strcmp(key,dini_Get(file,"password"),true))
    {
        SendClientMessage(playerid,RED,"Logged in!");
        SpawnPlayer(playerid);// here it is...
        LoadAcc(playerid);
        return 1;
    }
    else
    {
        // bla bla bla retype pass...
        return 1;
    }
}



Re: Disable player spawn button - milanosie - 05.06.2012

If u toggleplayerspectating 0 it automatically spawns him/her


Re: Disable player spawn button - MarinacMrcina - 05.06.2012

Quote:
Originally Posted by milanosie
Посмотреть сообщение
If u toggleplayerspectating 0 it automatically spawns him/her
Can you put that in my script please


Re: Disable player spawn button - milanosie - 05.06.2012

How hard is it to place

TogglePlayerSpectating(playerid, 1);

At the OnPlayerRequestClass.


and TogglePlayerSpectating(playerid, 0);


At the login dialog....


EDIT:

dini_Get(file,"password")



You are using flat-file passwords, change it to hash, This is insecure and dangerous,