SA-MP Forums Archive
Invalid function or declaration - 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: Invalid function or declaration (/showthread.php?tid=635341)



Invalid function or declaration - Cyboorg - 05.06.2017

Quote:

C:\Users\Desktop\SERVER\filterscripts\myscript.pwn (341) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Line 341


PHP Code:
public OnPlayerEnterVehicle(playerid5980)
{
    
SetPlayerWantedLevel(playerid6);
    
SendClientMessage(playeridRED"Law enforcement vehicle theft [WANTED LEVEL INCREASED]");
    return 
1;




Re: Invalid function or declaration - Vince - 05.06.2017

Yeah, it doesn't work like that. Check this example here: https://sampwiki.blast.hk/wiki/GetVehicleModel


Re: Invalid function or declaration - renatog - 05.06.2017

PHP Code:
public OnPlayerEnterVehicle(playerid5980
You must provide the parameter names:
PHP Code:
OnPlayerEnterVehicle(playeridvehicleidispassenger
Then you use the values in your code inside the callback's body:
PHP Code:
OnPlayerEnterVehicle(playeridvehicleidispassenger)

    if(
GetVehicleModel(vehicleid) == 598 && !ispassenger)
    {
        
SetPlayerWantedLevel(playerid6); 
        
SendClientMessage(playeridRED"Law enforcement vehicle theft [WANTED LEVEL INCREASED]"); 
        return 
1
    }




Re: Invalid function or declaration - Cyboorg - 05.06.2017

Oh thank you . I searched but couldn't find that.

Thank you.


Re: Invalid function or declaration - Cyboorg - 05.06.2017

xDDDD


Re: Invalid function or declaration - Cyboorg - 06.06.2017

How to add it for a selected class ?
Ex: only when civilians enter in veh will get wanted.