Requesting help with adding player class
#1

I am in progress of making my own RP server, I been readings tut after tut for the past 2 days trying to pick up on scripting since I never did any type of coding before this is a little complicated lol. Anyways I need a player class for my server, I found a tut that explains some of it but I would like to know how to make a menu out of it for like cops, army, civilian, and so on with some of them being locked so not just anyone can be in the army for example.
Reply
#2

under the
pawn Код:
OnPlayerRequestClass
callback check which class the player is trying to chose...if oyu want it locked do not let the player spawn and send him a message or show a gametext/textdraw saying that he can't choose that class or something.
Reply
#3

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
under the
pawn Код:
OnPlayerRequestClass
callback check which class the player is trying to chose...if oyu want it locked do not let the player spawn and send him a message or show a gametext/textdraw saying that he can't choose that class or something.
So like this?

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerCameraPos(playerid, 1677.4528,-1502.6893,152.1802);
    SetPlayerCameraLookAt(playerid, 1677.4528,-1502.6893,152.1802);
    SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
    return 1;
}
What else is missing, when I go to start the game it just spawns me out of the boundaries....
Reply
#4

Delete the first 2 lines....keep only the SetPlayerSkin line...and as far as spawning out of boundries is concerned...it is a problem with OnPlayerSpawn....


I guess this should help you..
Reply
#5

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
Delete the first 2 lines....keep only the SetPlayerSkin line...and as far as spawning out of boundries is concerned...it is a problem with OnPlayerSpawn....


I guess this should help you..
Thanks, also why delete the first 2 lines? The wiki tuts said to place them in, is it wrong to use?
Reply
#6

They are not wrong...but while the code is being executed the players camera will be in the place you have defined there and as soon as the code is completed(i mean the players ets his skin) the camera will reset....it might lagg for the player..
You can keep it...no harm will be done.
Reply
#7

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
They are not wrong...but while the code is being executed the players camera will be in the place you have defined there and as soon as the code is completed(i mean the players ets his skin) the camera will reset....it might lagg for the player..
You can keep it...no harm will be done.
I think I will delete it lol, I'd rather minimize as much issues as possible. Thanks for the help, also I asked in another post but got no reply and I am wondering if you could help me....anyways I am looking into possibly adding a huge Welcome text on the players screen for when they enter but only found tuts to place a text into the chat bar. Do you know how to do it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)