SA-MP Forums Archive
whats wrong - 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: whats wrong (/showthread.php?tid=664618)



whats wrong - PepsiCola23 - 05.03.2019

PHP код:
CMD:tollmenu(playeridparams[])
{
    
//if(!IsACop(playerid)) return SCM(playerid, COLOR_LGREEN, "a!");
    //if(PlayerInfo[playerid][pRank] < 6) return SCM(playerid, COLOR_LGREEN, "b!");
    //if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "c!");
    
new sDialog[120];
    if(
toll == 0format(sDialogsizeof(sDialog), "The LS/LV toll is{80FF00}(Open){FFFFFF}Click to close.");
    else if(
toll == 1format(sDialogsizeof(sDialog), "Tge LS/LV toll is {FF0000}(Closed){FFFFFF}Click to open.");
    
ShowPlayerDialog(playeridDIALOG_TOLLMENUDIALOG_STYLE_LIST"Cop toll menu"sDialog"Ok""Exit");
    return 
1;

the cmd doesnt work if i add these lines
PHP код:
    if(!IsACop(playerid)) return SCM(playeridCOLOR_LGREEN"a!");
    if(
PlayerInfo[playerid][pRank] < 6) return SCM(playeridCOLOR_LGREEN"b!");
    if(
OnDuty[playerid] == 0) return SCM(playeridCOLOR_LGREEN"c!"); 
what s the problem?


Re: whats wrong - TheToretto - 05.03.2019

Well... Statements return false so... What does it output? A B or C?


Re: whats wrong - PepsiCola23 - 05.03.2019

it doesn return anything and there is no output.

the script just crashes

note:its in an include


Re: whats wrong - TheToretto - 05.03.2019

That's not possible.. Does it compile successfully? Is SCM defined? Show how it is.