SA-MP Forums Archive
Scripting Errors - 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: Scripting Errors (/showthread.php?tid=391571)



Scripting Errors - KeenanRitchie - 10.11.2012

PHP код:
C:\Users\Keenan\Desktop\KA-RP SERVER\gamemodes\KA-RP.pwn(13087) : error 017undefined symbol "IsACop"
C:\Users\Keenan\Desktop\KA-RP SERVER\gamemodes\KA-RP.pwn(13087) : warning 215expression has no effect
C
:\Users\Keenan\Desktop\KA-RP SERVER\gamemodes\KA-RP.pwn(13087) : error 001expected token";"but found "]"
C:\Users\Keenan\Desktop\KA-RP SERVER\gamemodes\KA-RP.pwn(13087) : error 029invalid expressionassumed zero
C
:\Users\Keenan\Desktop\KA-RP SERVER\gamemodes\KA-RP.pwn(13087) : fatal error 107too many error messages on one line 
Can anyone help?


Re: Scripting Errors - Team_PRO - 10.11.2012

Will you Please Show The Line


Re: Scripting Errors - JakeMiller - 10.11.2012

please show us the line


Re: Scripting Errors - Team_PRO - 10.11.2012

Show This Line Please
PHP код:
C:\Keenan\mum\Desktop\KA-RP SERVER\gamemodes\KA-RP.pwn(13087) : error 017undefined symbol "IsACop" 
C:\Users\Keenan\Desktop\KA-RP SERVER\gamemodes\KA-RP.pwn(13087) : warning 215expression has no effect 
C
:\Users\Keenan\Desktop\KA-RP SERVER\gamemodes\KA-RP.pwn(13087) : error 001expected token";"but found "]" 
C:\Users\Keenan\Desktop\KA-RP SERVER\gamemodes\KA-RP.pwn(13087) : error 029invalid expressionassumed zero 
C
:\Users\Keenan\Desktop\KA-RP SERVER\gamemodes\KA-RP.pwn(13087) : fatal error 107too many error messages on one line 
How We Can Help You if you didn't show us the line


Re: Scripting Errors - KeenanRitchie - 10.11.2012

PHP код:
CMD:siren(playeridparams[])
{
    if 
IsACop(playerid) || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 12)
    {
        new 
string[128], type;
        new 
VID GetPlayerVehicleID(playerid);
        if(
sscanf(params"d"type))
        {
            
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /siren [type]");
            
SendClientMessageEx(playeridCOLOR_GRAD2"Type: 1 = Small (Inside Dashbord), 2 = Large (Roof), 3 = Off.");
            return 
1;
        }
        switch(
type)
        {
            case 
1:
            {
                if(
Siren[VID] == 1)
                {
                    
SendClientMessageEx(playeridCOLOR_GRAD2"This vehicle already has a siren!");
                    return 
1;
                }
                new 
sendername[MAX_PLAYER_NAME];
                
Siren[VID] = 1;
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
SirenObject[VID] = CreateObject(1864610.010.010.0000);
                
AttachObjectToVehicle(SirenObject[VID], VID0.00.750.2750.00.10.0);
                
format(stringsizeof(string), "* %s puts the siren on the dashboard."sendername);
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                return 
1;
            }
            case 
2:
            {
                if(
Siren[VID] == 1)
                {
                    
SendClientMessageEx(playeridCOLOR_GRAD2"This vehicle already has a siren!");
                    return 
1;
                }
                
Siren[VID] = 1;
                new 
sendername[MAX_PLAYER_NAME];
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
SirenObject[VID] = CreateObject(19419000000);
                
AttachObjectToVehicle(SirenObject[VID], VID0.009999, -0.0199990.9449990.0000000.0000000.000000);
                
format(stringsizeof(string), "* %s puts the siren on the roof."sendername);
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                return 
1;
            }
            case 
3:
            {
                if(
Siren[VID] == 0)
                {
                    
SendClientMessageEx(playeridCOLOR_GRAD2"This vehicle doesn't have a siren on it!");
                    return 
1;
                }
                
Siren[VID] = 0;
                new 
sendername[MAX_PLAYER_NAME];
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
DestroyObject(SirenObject[VID]);
                
format(stringsizeof(string), "* %s takes down the siren."sendername);
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                return 
1;
            }
            default:
            {
                
SendClientMessageEx(playeridCOLOR_WHITE"Invalid license type! /siren [type]");
                
SendClientMessageEx(playeridCOLOR_GRAD2"Type: 1 = Roof, 2 = Inside, 3 = Off.");
            }
        }
    }
    else 
SendClientMessageEx(playeridCOLOR_GREY"You're not authorised to use this command.");
    return 
1;


thats what i added on


ive already added these
PHP код:
new Siren[MAX_VEHICLES];
new 
SirenObject[MAX_VEHICLES]; 



Re: Scripting Errors - Team_PRO - 10.11.2012

what is the line
Quote:

13087




Re: Scripting Errors - KeenanRitchie - 10.11.2012

Quote:
Originally Posted by Team_PRO
Посмотреть сообщение
what is the line
PHP код:
if IsACop(playerid) || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 12



Re: Scripting Errors - Team_PRO - 10.11.2012

But When I Compile it there is no error


Re: Scripting Errors - Team_PRO - 10.11.2012

Try This

PHP код:

CMD
:siren(playeridparams[]) 
    if 
IsACop(playerid) || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 12
    { 
        new 
string[128], type
        new 
VID GetPlayerVehicleID(playerid); 
        if(
sscanf(params"d"type)) 
        { 
            
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /siren [type]"); 
            
SendClientMessageEx(playeridCOLOR_GRAD2"Type: 1 = Small (Inside Dashbord), 2 = Large (Roof), 3 = Off."); 
            return 
1
        } 
        switch(
type
        { 
            case 
1
            { 
                if(
Siren[VID] == 1
                { 
                    
SendClientMessageEx(playeridCOLOR_GRAD2"This vehicle already has a siren!"); 
                    return 
1
                } 
                new 
sendername[MAX_PLAYER_NAME]; 
                
Siren[VID] = 1
                
GetPlayerName(playeridsendernamesizeof(sendername)); 
                
SirenObject[VID] = CreateObject(1864610.010.010.0000); 
                
AttachObjectToVehicle(SirenObject[VID], VID0.00.750.2750.00.10.0); 
                
format(stringsizeof(string), "* %s puts the siren on the dashboard."sendername); 
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
                return 
1
            } 
            case 
2
            { 
                if(
Siren[VID] == 1
                { 
                    
SendClientMessageEx(playeridCOLOR_GRAD2"This vehicle already has a siren!"); 
                    return 
1
                } 
                
Siren[VID] = 1
                new 
sendername[MAX_PLAYER_NAME]; 
                
GetPlayerName(playeridsendernamesizeof(sendername)); 
                
SirenObject[VID] = CreateObject(19419000000); 
                
AttachObjectToVehicle(SirenObject[VID], VID0.009999, -0.0199990.9449990.0000000.0000000.000000); 
                
format(stringsizeof(string), "* %s puts the siren on the roof."sendername); 
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
                return 
1
            } 
            case 
3
            { 
                if(
Siren[VID] == 0
                { 
                    
SendClientMessageEx(playeridCOLOR_GRAD2"This vehicle doesn't have a siren on it!"); 
                    return 
1
                } 
                
Siren[VID] = 0
                new 
sendername[MAX_PLAYER_NAME]; 
                
GetPlayerName(playeridsendernamesizeof(sendername)); 
                
DestroyObject(SirenObject[VID]); 
                
format(stringsizeof(string), "* %s takes down the siren."sendername); 
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
                return 
1
            } 
            default: 
            { 
                
SendClientMessageEx(playeridCOLOR_WHITE"Invalid license type! /siren [type]"); 
                
SendClientMessageEx(playeridCOLOR_GRAD2"Type: 1 = Roof, 2 = Inside, 3 = Off."); 
            } 
        } 
    } 
    else 
SendClientMessageEx(playeridCOLOR_GREY"You're not authorised to use this command."); 
    return 
1




Re: Scripting Errors - KeenanRitchie - 10.11.2012

send me what you complied?