Invalid Expression problem cant fix - 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 Expression problem cant fix (
/showthread.php?tid=327725)
Invalid Expression problem cant fix -
jaami - 22.03.2012
PHP код:
if(AdminDuty[i] == 0)
}
else (( This line i got error invalid expression))
{
(strcmp(PlayerInfo[i][pAdmName], "None", true) == 0);
}
{
format(string, 256, "%s: %s", admtext, sendername);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else (( This line i got error invalid expression))
{
format(string, 256, "%s: %s (on duty)", admtext, sendername);
SendClientMessage(playerid, TEAM_VAGOS_COLOR, string);
}
Please tell me whats the mistaken. Thank you
Re: Invalid Expression problem cant fix -
milanosie - 22.03.2012
If adminduty == 0...
What happens if that happens?
You immidiatly go to else
Re: Invalid Expression problem cant fix -
Daddy Yankee - 22.03.2012
deleted
Re: Invalid Expression problem cant fix -
DBan - 22.03.2012
pawn Код:
if(AdminDuty[i] == 0) return 0; //I assumed you wanted it to return 0 (even though it's completely pointless in the first place)
else //else what?
{
(strcmp(PlayerInfo[i][pAdmName], "None", true) == 0);
format(string, 256, "%s: %s", admtext, sendername);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else //yet again, else what?
{
format(string, 256, "%s: %s (on duty)", admtext, sendername);
SendClientMessage(playerid, TEAM_VAGOS_COLOR, string);
}
Untested, just some simple fixes/indents done. You didn't give us enough information to properly fix your code for you, therefore you are bound to have errors.
Re: Invalid Expression problem cant fix -
Bogdan1992 - 22.03.2012
pawn Код:
if(AdminDuty[i] == 0) return 0;
if else (AdminDuty[i] == 1) // == 1 or whatever
{
(strcmp(PlayerInfo[i][pAdmName], "None", true) == 0);
format(string, 256, "%s: %s", admtext, sendername);
SendClientMessage(playerid, COLOR_WHITE, string);
}else{
format(string, 256, "%s: %s (on duty)", admtext, sendername);
SendClientMessage(playerid, TEAM_VAGOS_COLOR, string);
}