Class selection / textdraw. -
Krish - 03.01.2009
Hi!
Is it possible to have textdraw on player class selection screen?
So when Grove Street man is selected, it states "LOS SANTOS", when Rifa is selected, it states "SAN FIERRO" and when Mafia is selected, it states "LAS VENTURAS"
Help me please!
P.S.: I am complete noob in textdraws
Thanks!
Re: Class selection / textdraw. -
Auto-Sized - 03.01.2009
Yes I have them for my skins, Civillians coppers etc.
pawn Код:
public OnPlayerRequestClass(playerid, classid)
if (classid >= 0 && classid <= 2 && udb_UserInt(PlayerName(playerid), "SkillChoosen") == 0)
{
TextDrawHideForPlayer(playerid, TextdrawCivillians); TextDrawHideForPlayer(playerid, TextdrawFirefighters); TextDrawShowForPlayer(playerid, TextdrawMedics);
TextDrawHideForPlayer(playerid, TextdrawTitle); TextDrawHideForPlayer(playerid, TextdrawRapist); TextDrawHideForPlayer(playerid, TextdrawRobber);
TextDrawHideForPlayer(playerid, TextdrawMugger); TextDrawHideForPlayer(playerid, TextdrawJacker); TextDrawHideForPlayer(playerid, TextdrawDrugDealer);
TextDrawHideForPlayer(playerid, TextdrawBurgler); TextDrawShowForPlayer(playerid, TextdrawInfector);
SendClientMessage(playerid, 0xB360FDFF,"Use: /skill 2 only."); SendClientMessage(playerid, 0xB360FDFF, "2. Infector");
}
From an old save of mine. Of course you will have too create them but thats how you would show them. Classid relates to the order you addplayerclass starting from 0,1,2,3,4. I would suggest that you group classes one after the other .i.e police one after the other, using this method, makes for easy coding.
Re: Class selection / textdraw. -
Krish - 03.01.2009
I have only 3 classes, so i did it other way:
pawn Код:
if (classid == 0)
{
format(string, sizeof(string), "~g~LOS SANTOS");
GameTextForPlayer(playerid,string,1000,6);
}
else if (classid == 1)
{
format(string, sizeof(string), "~b~SAN FIERRO");
GameTextForPlayer(playerid,string,1000,6);
}
else if (classid == 2)
{
format(string, sizeof(string), "~y~LAS VENTURAS");
GameTextForPlayer(playerid,string,1000,6);
}
Anyway, thanks, AutoSized
Re: Class selection / textdraw. -
Auto-Sized - 03.01.2009
No problem. That way is easier then doing textdraws. I think there is a text draw creator somewhere here you could look at that. Hold on I will Look.
http://forum.sa-mp.com/index.php?topic=29132.0
Yes there is shame mine where done before I found this. Try this.
Re: Class selection / textdraw. -
Scripterzors - 03.02.2009
Fuck. I can't do anything without getting atleast one fucking error. Ive copied yours. & edited it.
if (classid == 0..17)
{
format(string, sizeof(string), "~g~Civilian");
GameTextForPlayer(playerid,string,1000,6);
}
else if (classid == 18..23)
{
format(string, sizeof(string), "~w~White ~b~Angels ~w~ Bikers");
GameTextForPlayer(playerid,string,1000,6);
}
But. I get 'these' errors;
C:\Users\Madhouse\Desktop\Server\gamemodes\Country racin0.0.2.pwn.pwn(229) : error 010: invalid function or declaration
C:\Users\Madhouse\Desktop\Server\gamemodes\Country racin0.0.2.pwn.pwn(234) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Any help appreciated.
Re: Class selection / textdraw. -
Cueball - 03.02.2009
You can only use the .. statement in a case. Cases are used in switch statements. Check
pawn-lang.pdf for information about switch, case and ...
Instead of doing 0..17, you can do this:
pawn Код:
if(classid >= 0 && classid <= 17)
Do the same for 18 - 23.
I think you
may be able to do
but I'm not entirely sure, so don't hold me to it. Once again, check pawn-lang.pdf.
BTW, your syntax is wrong anyway, in a case statement it would be like this:
pawn Код:
switch(classid)
{
case 0..17:
// Code.
}
Notice how it is not '== 0..17'
~Cueball~
Re: Class selection / textdraw. -
Cueball - 03.02.2009
Quote:
Originally Posted by ssǝן‾ʎ
You can do 0<=classid<=17.
|
To be honest, I only knew about it from reading your posts, but i forgot about the exact syntax of it, so I thought I would just throw it in anyway with a caution.
By the way, I'm glad you're (somewhat) back now. It's unfortunate about everything that happened, and I am personally grateful you decided to show back up on the forum
~Cueball~