OnPlayerRequestClass -
Odyssey - 01.06.2011
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.
Re: OnPlayerRequestClass -
Jefff - 01.06.2011
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
Re: OnPlayerRequestClass -
Odyssey - 01.06.2011
I dont understand.
Re: OnPlayerRequestClass -
SchurmanCQC - 01.06.2011
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.
Respuesta: Re: OnPlayerRequestClass -
admantis - 01.06.2011
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.
Re: Respuesta: Re: OnPlayerRequestClass -
SchurmanCQC - 01.06.2011
Quote:
Originally Posted by admantis
it starts from 0.
|
Right, my bad.
Re: OnPlayerRequestClass -
Odyssey - 01.06.2011
So, where dose this all go in the code?
Re: OnPlayerRequestClass -
shitbird - 01.06.2011
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);
Re: OnPlayerRequestClass -
Odyssey - 02.06.2011
It works! Hooray, thanks guys.