error /20 command
#1

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;
}
Reply
#2

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;
}
Reply
#3

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
Reply
#4

But it not showing Location
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)