SA-MP Forums Archive
error 017: undefined symbol "isNumeric" - 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 017: undefined symbol "isNumeric" (/showthread.php?tid=628142)



Please help me! - SuperZak - 06.02.2017

Hello!
I added Ryder race system to my gamemode, but there's an error C:\Users\zaki\Desktop\My server\gamemodes\Steve.pwn(4418) : error 017: undefined symbol "isNumeric"

I downloaded dini 1.6 and used it, but it didn't fix that problem..

Here's some lines

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
599:
        {
            if(!
response) return BuildRace 0;
            switch(
listitem)
            {
                case 
0BuildRaceType 0;
                case 
1BuildRaceType 3;
            }
            
ShowDialog(playerid600);
        }
        case 
600..601:
        {
            if(!
response) return ShowDialog(playerid599);
            if(!
strlen(inputtext)) return ShowDialog(playerid601);
            if(
strlen(inputtext) < || strlen(inputtext) > 20) return ShowDialog(playerid601);
            
strmid(BuildNameinputtext0strlen(inputtext), sizeof(BuildName));
            
ShowDialog(playerid602);
        }
        case 
602..603:
        {
            if(!
response) return ShowDialog(playerid600);
            if(!
strlen(inputtext)) return ShowDialog(playerid603);
4418            if(isNumeric(inputtext))
            {
                if(!
IsValidVehicle(strval(inputtext))) return ShowDialog(playerid603);
                new
                    
FloatpPos[4]
                ;
                
GetPlayerPos(playeridpPos[0], pPos[1], pPos[2]);
                
GetPlayerFacingAngle(playeridpPos[3]);
                
BuildModeVID strval(inputtext);
                
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00);
                
BuildVehicle CreateVehicle(strval(inputtext), pPos[0], pPos[1], pPos[2], pPos[3], random(126), random(126), (60 60));
                
PutPlayerInVehicle(playeridBuildVehicle0);
                
BuildCreatedVehicle 0x01;
                
ShowDialog(playerid604);
            }
            else
            {
                if(!
IsValidVehicle(ReturnVehicleID(inputtext))) return ShowDialog(playerid603);
                new
                    
FloatpPos[4]
                ;
                
GetPlayerPos(playeridpPos[0], pPos[1], pPos[2]);
                
GetPlayerFacingAngle(playeridpPos[3]);
                
BuildModeVID ReturnVehicleID(inputtext);
                
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00);
                
BuildVehicle CreateVehicle(ReturnVehicleID(inputtext), pPos[0], pPos[1], pPos[2], pPos[3], random(126), random(126), (60 60));
                
PutPlayerInVehicle(playeridBuildVehicle0);
                
BuildCreatedVehicle 0x01;
                
ShowDialog(playerid604);
            }
        }
        case 
604:
        {
            if(!
response) return ShowDialog(playerid602);
            
SendClientMessage(playeridGREEN">> Go to the start line on the left road and press 'KEY_FIRE' and do the same with the right road block.");
            
SendClientMessage(playeridGREEN"   - When this is done, you will see a dialog to continue.");
            
BuildVehPosCount 0;
            
BuildTakeVehPos true;
        }
        case 
605:
        {
            if(!
response) return ShowDialog(playerid604);
            
SendClientMessage(playeridGREEN">> Start taking checkpoints now by clicking 'KEY_FIRE'.");
            
SendClientMessage(playeridGREEN"   - IMPORTANT: Press 'ENTER' when you're done with the checkpoints! If it doesn't react press again and again.");
            
BuildCheckPointCount 0;
            
BuildTakeCheckpoints true;
        }
        case 
606:
        {
            if(!
response) return ShowDialog(playerid606);
            
BuildRace 0;
            
BuildCheckPointCount 0;
            
BuildVehPosCount 0;
            
BuildTakeCheckpoints false;
            
BuildTakeVehPos false;
            
BuildCreatedVehicle = (BuildCreatedVehicle == 0x01) ? (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00) : (DestroyVehicle(BuildVehicle), BuildCreatedVehicle 0x00);
        }
    }
    return 
1;

I wrote line 4418 as '4418' there..
Hope someone can help me!
Thanks!


Re: error 017: undefined symbol "isNumeric" - AjaxM - 06.02.2017

Add this anywhere on your gamemode but not under any callbacks.

PHP код:
IsNumeric(const string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;




Re: error 017: undefined symbol "isNumeric" - SuperZak - 06.02.2017

Can you please tell me where exactly should I add this?
Cuz I got a warning and same error..
EDIT : I added it above callbacks but it didn't work too..


Re: error 017: undefined symbol "isNumeric" - AndreiWow - 06.02.2017

Try to use isnumeric full lowercase


Re: error 017: undefined symbol "isNumeric" - SuperZak - 06.02.2017

umm.. Link please?
I never heared about this tho


Re: error 017: undefined symbol "isNumeric" - AndreiWow - 06.02.2017

Just change isNumeric with isnumeric.. try it, it may work, atleast it did for me


Re: error 017: undefined symbol "isNumeric" - SuperZak - 06.02.2017

Omg, I didn't understand u sorry, That's cuz I'm from algeria, and I only learned english 2 years..
Thanks so much it worked!


Re: error 017: undefined symbol "isNumeric" - princejeet1510 - 06.02.2017

Quote:
Originally Posted by AndreiWow
Посмотреть сообщение
Try to use isnumeric full lowercase
Quote:
Originally Posted by SuperZak
Посмотреть сообщение
umm.. Link please?
I never heared about this tho
No offense but wtf...
That made me life for hours man...... OMFG....