SA-MP Forums Archive
How to get the the race name? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to get the the race name? (/showthread.php?tid=147797)



How to get the the race name? - 0ne - 14.05.2010

Could anyone tell me how to get the race name and form a command like this:

pawn Код:
if(AirRaceI[CurrentAirRace][Name] == AirRace1)



Re: How to get the the race name? - Kyosaur - 14.05.2010

You have to use strcmp to compare to strings together.


Re: How to get the the race name? - 0ne - 14.05.2010

Example please, if you can.


Re: How to get the the race name? - Kyosaur - 14.05.2010

Quote:
Originally Posted by 0ne
Example please, if you can.
Код:
if(!strcmp(AirRaceI[CurrentAirRace][Name], "AirRace1", false))
No offense, but you're going to have a difficult time modding a race script if you dont even know how to compare strings to each other. Best of luck to you though .


Re: How to get the the race name? - 0ne - 14.05.2010

I already done the script except for getting it's name and putting in right vehicles, thats all.

Just tested the code works very good! Thank you for the fast answers mate. :P