OnPlayerRequestClass
#1

Hey! Its your regular customor TechKid! Yes, sorry for yet again post a help thread. Im trying to make a class section using OnPlayerRequestClass, for LVA, LSA, SFA, for ATC and Pilots. But the GameText isnt showing for some reason. Heres the script what is placed in the gamemode.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid,-1753.6743,885.2703,295.8750);
    SetPlayerCameraPos(playerid,-1753.6849,892.0016,295.8750);
    SetPlayerCameraLookAt(playerid,-1753.6743,885.2703,295.8750);
    switch (classid)
    {
        case 61:
        {
            new string[50];
            format(string, sizeof(string), "LVA Pilot");
            GameTextForPlayer(playerid, string, 3000, 6);
        }
        case 164:
        {
            new string[50];
            format(string, sizeof(string), "LVA ATC");
            GameTextForPlayer(playerid, string, 3000, 6);
        }
    }
    return 1;
}
This is on OnGameModeInit

pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("SVP V0.5");
    AddPlayerClass(61,1319.6895,1261.8535,10.8436,0.0000,0,0,0,0,0,0);
    AddPlayerClass(164,1319.6895,1261.8535,10.8436,0.0000,0,0,0,0,0,0);
           //There more, the map file and the return
But the game text just aint showing, I am using strings to see if that would help, it didint.

Anyways, my gamemode is nearly done, expect a couple more posts from me.

Any help is apreciated.
Reply
#2

pawn Код:
AddPlayerClass(61,1319.6895,1261.8535,10.8436,0.0000,0,0,0,0,0,0); // classid == 0
AddPlayerClass(164,1319.6895,1261.8535,10.8436,0.0000,0,0,0,0,0,0); // calssid == 1
Reply
#3

I dont understand.
Reply
#4

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
AddPlayerClass(61,1319.6895,1261.8535,10.8436,0.0000,0,0,0,0,0,0); // classid == 0
AddPlayerClass(164,1319.6895,1261.8535,10.8436,0.0000,0,0,0,0,0,0); // calssid == 1
Correct.

Class ids aren't skin ids, they're the classes in order.

So, if you have 5 createclasses in a row, the one in front will be 1, then 2, then 3, 4, 5 and so on.
Reply
#5

Quote:
Originally Posted by Schurman
Посмотреть сообщение
Correct.

Class ids aren't skin ids, they're the classes in order.

So, if you have 5 createclasses in a row, the one in front will be 1, then 2, then 3, 4, 5 and so on.
it starts from 0.
Reply
#6

Quote:
Originally Posted by admantis
Посмотреть сообщение
it starts from 0.
Right, my bad.
Reply
#7

So, where dose this all go in the code?
Reply
#8

You simply change the skin ids to the classids, and it'll play along.
Edit: Also, remove the strings, you're wasting bytes. You can simply use:
pawn Код:
GameTextForPlayer(playerid, "text", ms, style);
Reply
#9

It works! Hooray, thanks guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)