SA-MP Forums Archive
these define make Pawn Compiler stop roking - 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: these define make Pawn Compiler stop roking (/showthread.php?tid=366974)



these define make Pawn Compiler stop roking - ZBits - 08.08.2012

Hello guys i have these defines when i enter them it make my pawn compiler strop working

pawn Код:
#define ForEach(%0,%1) \
    for(new %0 = 0; %0 != %1; %0++) if(IsPlayerConnected(%0) && !IsPlayerNPC(%0))

#define Loop(%0,%1) \
    for(new %0 = 0; %0 != %1; %0++)
   
#define IsOdd(%1) \
    ((%1) & 1)
   
#define ConvertTime(%0,%1,%2,%3,%4) \
    new \
        Float: %0 = floatdiv(%1, 60000) \
    ;\
    %2 = floatround(%0, floatround_tozero); \
    %3 = floatround(floatmul(%0 - %2, 60), floatround_tozero); \
    %4 = floatround(floatmul(floatmul(%0 - %2, 60) - %3, 1000), floatround_tozero)
   
#define function%0(%1) \
    forward%0(%1); public%0(%1)



Re: these define make Pawn Compiler stop roking - Vince - 08.08.2012

Why do people insist on cramming everything into a definition? Use a function for ConvertTime. Rest looks fine.


Re: these define make Pawn Compiler stop roking - ZBits - 08.08.2012

What type of Convertime function?


Re: these define make Pawn Compiler stop roking - ZBits - 08.08.2012

nvm it worked


Re : these define make Pawn Compiler stop roking - ricardo178 - 08.08.2012

Didn't know you scripted too.


Re: these define make Pawn Compiler stop roking - ZBits - 08.08.2012

xD i quit scripting but i came back

Anyways i get this error

Код:
C:\Users\Sony\Desktop\USA Gang Wars TDM\gamemodes\Usagangwarsv1.3.pwn(2912) : error 017: undefined symbol "isnull"
C:\Users\Sony\Desktop\USA Gang Wars TDM\gamemodes\Usagangwarsv1.3.pwn(2913) : error 017: undefined symbol "params"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
the lines are

pawn Код:
if(isnull(params))return SendClientMessage(playerid, COLOR_SININE, "USAGE: /startrace [racename]");
LoadRace(playerid, params);
Need help


Re : these define make Pawn Compiler stop roking - ricardo178 - 08.08.2012

Post whole cmd.


Re: these define make Pawn Compiler stop roking - ZBits - 08.08.2012

pawn Код:
dcmd_startrace(playerid, cmdtext[])
{
#pragma unused cmdtext
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: Unknown command.");
if(AutomaticRace == true) return SendClientMessage(playerid, COLOR_PINK2, "Not possible.Automatic race is enabled!");
if(BuildRace != 0) return SendClientMessage(playerid, COLOR_PINK2, "There's someone building a race!");
if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, COLOR_PINK2, "A race currently going on. Wait till the race ends");
if(isnull(params))return SendClientMessage(playerid, COLOR_SININE, "USAGE: /startrace [racename]");
LoadRace(playerid, params);
return 1;
}



Re: these define make Pawn Compiler stop roking - SuperViper - 08.08.2012

Replace cmdtext with params at the top of your command.