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(playerid, vehicleid, ispassenger);
{
LINE WITH THE ERROR: if(MaskOn[playerid] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
foreach(Player,i)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
}
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] == 1 || Mask[playerid] == 1)
{
if(MaskOn[playerid] == 0)
{
//new vehicleid = GetPlayerVehicleID(playerid);
MaskOn[playerid] = 1;
GameTextForPlayer(playerid, "~p~MASK ON", 5000, 3);
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(playerid, i, 0); //ShowPlayerNameTagForPlayer(i, playerid, false);
}
}
else if(MaskOn[playerid] == 1)
{
MaskOn[playerid] = 0;
GameTextForPlayer(playerid, "~p~MASK OFF", 5000, 3);
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, 1);
}
return 1;
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nu ai o masca.");
}
}
if(!IsPlayerInAnyVehicle(playerid))
{
if(PlayerInfo[playerid][pMask] == 1 || Mask[playerid] == 1)
{
if(MaskOn[playerid] == 0)
{
//new vehicleid = GetPlayerVehicleID(playerid);
MaskOn[playerid] = 1;
GameTextForPlayer(playerid, "~p~MASK ON", 5000, 3);
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(playerid, i, 0); //ShowPlayerNameTagForPlayer(i, playerid, false);
}
}
else if(MaskOn[playerid] == 1)
{
MaskOn[playerid] = 0;
GameTextForPlayer(playerid, "~p~MASK OFF", 5000, 3);
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, 1);
}
return 1;
}
else
{
SCM(playerid, COLOR_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.