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



Error. - ImprezBart - 12.10.2011

Код:
CMD:help(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
	SCM(playerid,COLOR_WHITE,"/adminhelp");
    }
	SCM(playerid,COLOR_LIGHTBLUE,"__________________HELP___________________");
	SCM(playerid,COLOR_WHITE,"CAR HELP: /deletecar, /veh, /park, /addrims");
	SCM(playerid,COLOR_WHITE,"CHAT HELP: /o, /b, /local,/shout, ");
	SCM(playerid,COLOR_WHITE,"GENERAL HELP: /buylevel ");
    }
    else
    {
        SCM(playerid,COLOR_WHITE,"[SERVER]: You're not authorized to use this command");
	return 0;
    }
}
line 478-481
Код:
else
 	         {
		         SCM(playerid,COLOR_WHITE,"[SERVER]: You're not authorized to use this command");
		         return 0;
Код:
C:\Users\Bart\Downloads\Roleplay\Roleplay\gamemodes\esrp.pwn(478) : error 010: invalid function or declaration
C:\Users\Bart\Downloads\Roleplay\Roleplay\gamemodes\esrp.pwn(481) : error 010: invalid function or declaration



Re: Error. - iJumbo - 12.10.2011

You want if you are admin you can see the "/adminhelp" message else show only the other help?

pawn Код:
CMD:help(playerid, params[])
{
    SCM(playerid,COLOR_LIGHTBLUE,"__________________HELP___________________");
    SCM(playerid,COLOR_WHITE,"CAR HELP: /deletecar, /veh, /park, /addrims");
    SCM(playerid,COLOR_WHITE,"CHAT HELP: /o, /b, /local,/shout, ");
    SCM(playerid,COLOR_WHITE,"GENERAL HELP: /buylevel ");
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        SCM(playerid,COLOR_WHITE,"ADMIN HELP: /adminhelp");
    }
    return 1;
}
like this?


Re: Error. - ImprezBart - 12.10.2011

Yea, thanks. you were just to late i changed it myself

Quote:

CMD:help(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
SCM(playerid,COLOR_WHITE,"/adminhelp");
}
SCM(playerid,COLOR_LIGHTBLUE,"__________________HE LP___________________");
SCM(playerid,COLOR_WHITE,"CAR HELP: /deletecar, /veh, /park, /addrims");
SCM(playerid,COLOR_WHITE,"CHAT HELP: /o, /b, /local,/shout, ");
SCM(playerid,COLOR_WHITE,"GENERAL HELP: /buylevel ");
return 1;
}




Re: Error. - Lenny the Cup - 12.10.2011

You can't have anything between
pawn Код:
if(something)
{
    blabla;
}
// HERE
else
{
    blabla;
}
Edit:
I just think you have an unintentional } in there:
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 1)
    {
    SCM(playerid,COLOR_WHITE,"/adminhelp");
    // } Remove this line
    SCM(playerid,COLOR_LIGHTBLUE,"__________________HELP___________________");
    SCM(playerid,COLOR_WHITE,"CAR HELP: /deletecar, /veh, /park, /addrims");
    SCM(playerid,COLOR_WHITE,"CHAT HELP: /o, /b, /local,/shout, ");
    SCM(playerid,COLOR_WHITE,"GENERAL HELP: /buylevel ");
    }