error /20 command - 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: error /20 command (
/showthread.php?tid=436597)
error /20 command -
DerickClark - 12.05.2013
Error /20 command
Код:
error 017: undefined symbol "GetPlayer2DZone"
error 017: undefined symbol "Loc"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Код:
CMD:20(playerid,params[])
{
GetPlayer2DZone(playerid,Loc,sizeof(Loc));
new string[64];
format(string,sizeof(string),"My 10-20 is %s [Location]", Loc);
SendPlayerMessageToAll(playerid,string);
return 1;
}
Re: error /20 command -
Hoborific - 12.05.2013
I'm not quite sure if this is the problem, but it is bad practice to assign a numeric value as a command name, even in zcmd I don't think it handles it very well, maybe call the command
Код:
CMD:twenty(playerid,params[])
{
GetPlayer2DZone(playerid,Loc,sizeof(Loc));
new string[64];
format(string,sizeof(string),"My 10-20 is %s [Location]", Loc);
SendPlayerMessageToAll(playerid,string);
return 1;
}
commands are also not case sensitive inside SA-MP, but it's best to leave them completely lowercase when creating them.
I also don't see where you've created the variable Loc, You don't need to make it globally scoped, I'd recommend just adding it at the top of the command.
Here:
pawn Код:
CMD:twenty(playerid,params[])
{
new Loc;
GetPlayer2DZone(playerid,Loc,sizeof(Loc));
new string[64];
format(string,sizeof(string),"My 10-20 is %s [Location]", Loc);
SendPlayerMessageToAll(playerid,string);
return 1;
}
Re: error /20 command -
feartonyb - 12.05.2013
Use
Код:
stock Get2DZone(zone[], len, Float:x, Float:y )
{
for(new i = 0; i != sizeof(SA_GPS_ZONE_NAMES); i++ ){
if(x >= SA_GPS_ZONE_NAMES[i][Zone_Area][0] && x <= SA_GPS_ZONE_NAMES[i][Zone_Area][3] && y >= SA_GPS_ZONE_NAMES[i][Zone_Area][1] && y <= SA_GPS_ZONE_NAMES[i][Zone_Area][4]){
return format(zone, len, SA_GPS_ZONE_NAMES[i][Zone_Name], 0);}
}
return 0;
}
and define Loc
Re: error /20 command -
DerickClark - 12.05.2013
But it not showing Location