[help] making a simple marco - 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)
+--- Thread: [help] making a simple marco (
/showthread.php?tid=326458)
[help] [sloved] making a simple marco -
Jonny5 - 17.03.2012
im trying to understand this , so please forgive me
i got a bunch of stocks that i think i should convert to marcos.
first off tell me if theres no advantage to converting these stocks,
and second if you can help me convert 1 stock I can learn from that and do the rest(hopefully) lol
so i got this stock
pawn Код:
stock IsASemi(vid){
switch(vid)
{
case 403,514,515,443:return 1;
}
return 0;
}
and heres my marco for it
pawn Код:
#define IsASemi(%0) \
if((%0) == 403 || (%0) == 514 || (%0) == 515 || (%0) == 443){ return 1;}
im not sure if i should use the switch case or the if.. statement.
they both do the same thing but having a hard time getting the marco to work
i got this messed up!!
all my other stocks are very similar
so should be easy to convert after i see how this one is done,
thanks for the help
Re: [help] making a simple marco -
IstuntmanI - 17.03.2012
Код:
#define IsASemi(%0) \
((%0) == 403 || (%0) == 514 || (%0) == 515 || (%0) == 443)
Example:
Код:
CMD:issemi( playerid, params[ ] )
{
if( IsSemi( GetVehicleModel( GetPlayerVehicleID( playerid ) ) ) )
return SendClientMessage( playerid, -1, "You have a semi !" );
SendClientMessage( playerid, -1, "You don't have a semi !" );
return 1;
}
Re: [help] making a simple marco -
Jonny5 - 17.03.2012
awesome that works!!!
i see what went wrong,
the output i would have had would have been 2 nested if's
one without a condition
thank you for the help,
id +rep ya if i could
regards,