SA-MP Forums Archive
Error 10 - 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 10 (/showthread.php?tid=586035)



Error 10 - radiobizza - 18.08.2015

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger);
{
    
LINE WITH THE ERROR: if(MaskOn[playerid] == 1)
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            foreach(
Player,i)
            {
                
ShowPlayerNameTagForPlayer(iplayerid0);
            }
        }
    }
    return 
1;

The error is : error 010: invalid function or declaration


Re: Error 10 - Inn0cent - 18.08.2015

Can you show me where you made this variable, stock, or whatever.


Re: Error 10 - radiobizza - 18.08.2015

PHP код:
CMD:mask(playerid,params[])
{
    
//new string[256];
    //new sendername[MAX_PLAYER_NAME];
    
if(IsPlayerInAnyVehicle(playerid))
    {
        if(
PlayerInfo[playerid][pMask] == || Mask[playerid] == 1)
        {
            if(
MaskOn[playerid] == 0)
            {
                
//new vehicleid = GetPlayerVehicleID(playerid);
                
MaskOn[playerid] = 1;
                
GameTextForPlayer(playerid"~p~MASK ON"50003);
                for(new 
0MAX_PLAYERSi++)
                {
                    
ShowPlayerNameTagForPlayer(playeridi0); //ShowPlayerNameTagForPlayer(i, playerid, false);
                
}
            }
            else if(
MaskOn[playerid] == 1)
            {
                
MaskOn[playerid] = 0;
                
GameTextForPlayer(playerid"~p~MASK OFF"50003);
                for(new 
0MAX_PLAYERSi++) ShowPlayerNameTagForPlayer(playeridi1);
            }
            return 
1;
        }
        else
        {
            
SCM(playeridCOLOR_LIGHTRED"Nu ai o masca.");
        }
    }
    if(!
IsPlayerInAnyVehicle(playerid))
    {
        if(
PlayerInfo[playerid][pMask] == || Mask[playerid] == 1)
        {
            if(
MaskOn[playerid] == 0)
            {
                
//new vehicleid = GetPlayerVehicleID(playerid);
                
MaskOn[playerid] = 1;
                
GameTextForPlayer(playerid"~p~MASK ON"50003);
                for(new 
0MAX_PLAYERSi++)
                {
                    
ShowPlayerNameTagForPlayer(playeridi0); //ShowPlayerNameTagForPlayer(i, playerid, false);
                
}
            }
            else if(
MaskOn[playerid] == 1)
            {
                
MaskOn[playerid] = 0;
                
GameTextForPlayer(playerid"~p~MASK OFF"50003);
                for(new 
0MAX_PLAYERSi++) ShowPlayerNameTagForPlayer(playeridi1);
            }
            return 
1;
        }
        else
        {
            
SCM(playeridCOLOR_LIGHTRED"Nu ai o masca.");
        }
    }
    return 
1;




Re: Error 10 - Inn0cent - 18.08.2015

Where you made MaskOn variable.


Re: Error 10 - radiobizza - 18.08.2015

PHP код:
new MaskOn[MAX_PLAYERS]; 
On the top of script


Re: Error 10 - Inn0cent - 18.08.2015

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger); should be public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)


EDIT: You added ; at the end of public which should be at the end of forward.


Re: Error 10 - radiobizza - 18.08.2015

It's not the same?

EDIT: OH..I will fix that now


Re: Error 10 - radiobizza - 18.08.2015

It's still not working..


Re: Error 10 - Inn0cent - 18.08.2015

Whats wrong now? did you added forward OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
Up of the public.