Getting 3 unknown errors
#1

Hello, I am trying to compile a script, I have edited it and so on.. but I didn't even touch these parts.

I'm compiling with 0.3c includes and 0.3c pawno.

Error 1:

Quote:

Line 2822
error 017: undefined symbol "IsNumeric"

Line 2822 Code
Код:
stock ReturnVehicleModelID(string[])
{

	if(IsNumeric(string)) < This is Line 2822
	{
		new id = strval(string);

		if(id >= 400 && id <= 611)
		{
		    return id;
		}
	}

	for(new i = 0;i < sizeof(vehName);i++)
    {
        if(strfind(vehName[i],string,true) != -1)
        {
            return i + 400;
        }
    }
Next:

Quote:

Line 40443

error 047: array sizes do not match, or destination array is too small

Код:
dcmd_unban(playerid, params[])
{
	new name[120], file[126],string[100], string2[100], playerIP[256];
	if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pBanAppealer] == 1)
	{
		if (sscanf(params, "s", name)) return SendClientMessage(playerid, COLOR_GREY, "** [Usage]: /unban [Account Name]");
		format(file,sizeof(file),"%s.ini",name);
 		if(!fexist(file))
		{
  			SendClientMessage(playerid, COLOR_LIGHTRED, "** [Error]: Invalid player Account");
	    	return 1;
		}
		else
		{
			format(file, sizeof(file), "%s.ini", name);
			new File: hFile = fopen(file, io_append);
			if(hFile)
			{
   				new var[32];
   				playerIP = dini_Get(file, "IP"); < This is line 40443
				format(var, 32, "Band=0"); fwrite(hFile, var);
	            fclose(hFile);
			}
			format(string, sizeof(string), "unbanip %s", playerIP);
			SendRconCommand(string);
			SendRconCommand("reloadbans");
			SendClientMessage(playerid, COLOR_YELLOW, "** Member unbanned");
			format(string2, 256, "AdmCmd: %s has unbanned account '%s', and IP '%s'",PlayerName(playerid),name,playerIP);
			ABroadCast(COLOR_LIGHTRED, string2, 1);
		}
		return 1;
	}
	else
	{
		SendClientMessage(playerid, COLOR_LIGHTRED, "** [Error]: You are NOT an admin");
		return 1;
	}
}

    return 0;
}
Next:

Quote:

Line 40526

error 047: array sizes do not match, or destination array is too small

Код:
stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
	if(IsPlayerConnected(playerid))
	{
		new Float:posx, Float:posy, Float:posz;
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		new invehicle[MAX_PLAYERS];
		new virtualworld = GetPlayerVirtualWorld(playerid);
		new interior = GetPlayerInterior(playerid);
		new vehicleid = GetPlayerVehicleID(playerid);
		new ivehicleid;
		if(vehicleid) < This is line 40526
		{
			GetVehiclePos(vehicleid,oldposx,oldposy,oldposz);
		}
		else
		{
			GetPlayerPos(playerid, oldposx, oldposy, oldposz);
			vehicleid = GetPlayerVehicleID(playerid);
		}
		for(new i; i<MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
			    if(!BigEar[i])
			    {
					if(GetPlayerVirtualWorld(i) == virtualworld)
					{
						if((GetPlayerInterior(i) == interior))
						{
						    if(vehicleid)
						    {
							    if(IsPlayerInVehicle(i,vehicleid))
							    {
	          						invehicle[i] = 1;
								}
							}
							if(!invehicle[i])
							{
							    if(IsPlayerInAnyVehicle(i))
								{
								    ivehicleid = GetPlayerVehicleID(i);
								    GetVehiclePos(ivehicleid,posx,posy,posz);
								} else {
					    			GetPlayerPos(i,posx,posy,posz);
								}
								tempposx = (oldposx -posx);
								tempposy = (oldposy -posy);
								tempposz = (oldposz -posz);
								if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
								{
									SendClientMessage(i, col1, string);
								}
								else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
								{
									SendClientMessage(i, col2, string);
								}
								else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
								{
									SendClientMessage(i, col3, string);
								}
								else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
								{
									SendClientMessage(i, col4, string);
								}
								else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
								{
									SendClientMessage(i, col5, string);
								}
							}
							else
							{
								SendClientMessage(i, col1, string);
							}
						}
					}
				} else {
					SendClientMessage(i, col1, string);
				}
			}
		}
	}
	return 1;
}
Any help would be appreciated.

Thanks in advance.
Reply
#2

Heres something you can use:

pawn Код:
stock isNumeric(const string[]) {
    new length=strlen(string);
    if (length==0) return false;
    for (new i = 0; i < length; i++) {
        if (
        (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+')
        || (string[i]=='-' && i!=0)                                            
        || (string[i]=='+' && i!=0)                                            
        ) return false;
    }
    if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
    return true;
}
Reply
#3

Ok and what about the other two?

I'll try that.
Reply
#4

Can we see your array ?
Reply
#5

I got it fixed.

Nevermind, thanks anyways.
Reply
#6

Quote:
Originally Posted by Disturbed-
Посмотреть сообщение
I got it fixed.

Nevermind, thanks anyways.
No prob's m8'y, glad you got it sorted
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)