How to skip OnPlayerRequestClass?
#1

Hello everyone, I had a similar thread but it seems like it was deleted, so sorry for asking again.

How can I skin the screen where it requests to choose a skin and hit the "Spawn" button?
I need the character to spawn right after he clicked "okay" after inputting pass.

Another question, how to make a gun saving system, which will save the guns?
And how to give a player money amount only once, since I have pCash saving..and every time I enter I get money again and again.

And last question, is how to save the skin which a player bought, making him to spawn with it untill he'll buy a new one.

Thanks in advance.

EDIT: No ready stuff please, a tutorial would be really greatfull. (I was searching before I posted, didn't figure out.)
Reply
#2

Check for SetSpawnInfo (how to use it) and put it in the OnPlayerRequestClass callback, also when player logs add this SpawnPlayer(playerid);
Reply
#3

Quote:
Originally Posted by x96664
Посмотреть сообщение
Check for SetSpawnInfo (how to use it) and put it in the OnPlayerRequestClass callback, also when player logs add this SpawnPlayer(playerid);
Didn't work...?
Reply
#4

You must use a timer:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetTimerEx("SpawnThePlayer", 1, 0, "i", playerid);
    return 1;
}
pawn Код:
forward SpawnThePlayer(playerid);
public SpawnThePlayer(playerid)
{
    SpawnPlayer(playerid);
    return 1;
}
Greetz!
Reply
#5

Quote:
Originally Posted by Littl3j0hNy
Посмотреть сообщение
You must use a timer:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetTimerEx("SpawnThePlayer", 1, 0, "i", playerid);
    return 1;
}
pawn Код:
forward SpawnThePlayer(playerid);
public SpawnThePlayer(playerid)
{
    SpawnPlayer(playerid);
    return 1;
}
Greetz!
That worked fine! Thank you!
Reply
#6

Actually you can can just SpawnPlayer(playerid) when he presses "okay" like you wanted, with no timer -_-

Anyway, for the rest..
I've seen many gun saving systems on the forums, you can just check the script out to know how it's done.
As for the skin, just use GetPlayerSkin(playerid) and save it to his user file, then on the loading use SetPlayerSkin(playerid, Skin-here) [[Load the skin from the file and use SetPlayerSkin to make him use it]].

That's all! Good luck!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)