SA-MP Forums Archive
bypass OnPlayerRequestClass() - 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: bypass OnPlayerRequestClass() (/showthread.php?tid=475423)



bypass OnPlayerRequestClass() - Baltazar - 13.11.2013

Yes, I know... many people think, that it's a shit idea to force OnPlayerRequestClass right after connection to server. They solved this problem in some ways, but none of them satisfies my needs. The thing is that I don't want to add any code into OnPlayerRequestClass() since this callback shouldn't be called at all! How can I completely bypass it? Thanks


Re: bypass OnPlayerRequestClass() - DobbysGamertag - 13.11.2013

pawn Код:
public OnPlayerConnect(playerid)
{
    SpawnPlayer(playerid);
    return 1;
}
Something like that?


Re: bypass OnPlayerRequestClass() - PakistaniBaba - 13.11.2013

https://sampwiki.blast.hk/wiki/OnPlayerConnect
Check it mate and take your answer!!!


Re: bypass OnPlayerRequestClass() - Baltazar - 13.11.2013

Quote:
Originally Posted by PakistaniBaba
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/OnPlayerConnect
Check it mate and take your answer!!!
Found nothing useful. Besides the function SendClientMessageToAll()


Re : bypass OnPlayerRequestClass() - Matnix - 13.11.2013

By using :
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerSpectating(playerid, 1), TogglePlayerSpectating(playerid, 0); // auto spawn at 0
    // or on player connect..
    return 1;
}
correct me if I'm wrong


Re: Re : bypass OnPlayerRequestClass() - Baltazar - 13.11.2013

Quote:
Originally Posted by Matnix
Посмотреть сообщение
By using :
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerSpectating(playerid, 1), TogglePlayerSpectating(playerid, 0); // auto spawn at 0
    // or on player connect..
    return 1;
}
correct me if I'm wrong
Not a solution,... because this code means, that OnPlayerRequestClass() is being called. And that's exactly what I want to bypass . It does not have to be called. This code also means, that people are going to see arrows and spawn button for a fraction of a second and that looks so not cool.
I solved this problem partially already. How to make it not being called after death if f4 is pressed?