SA-MP Forums Archive
Guyz Help me Please ! Epic Problem - 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: Guyz Help me Please ! Epic Problem (/showthread.php?tid=369355)



Guyz Help me Please ! Epic Problem - Adam_Hardy - 16.08.2012

Guyz Help Please if its possible !

(9895) : error 029: invalid expression, assumed zero
(9895) : error 001: expected token: ";", but found "if"
(9897) : error 029: invalid expression, assumed zero
(9897) : error 001: expected token: ";", but found "if"



Код:
CMD:r(playerid, params[])
{
	new string[128];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsACop(playerid) && !IsAGov(playerid) && !IsAArmy(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD Oficer/Government Official.");
	if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/r)adio [text]");
	if(AntiAdv(playerid, params)) return 1;
	if(PlayerInfo[playerid][pFacDiv]){format(string, sizeof(string), "** [%s] %s %s: %s", RPFDN(playerid), RPFRN(playerid), RPN(playerid), params);}
	else if (!IsACop(playerid)) {format(string, sizeof(string), "** %s %s: %s", RPFRN(playerid), RPN(playerid), params);}
	SendPlayerFactionMessage(playerid, 0, COLOR_RADIO, string);
	else if (!IsAGov(playerid)) {format(string, sizeof(string), "** %s %s: %s", RPFRN(playerid), RPN(playerid), params);}
	SendPlayerFactionMessage(playerid, 0, COLOR_GREEN, string);
	else if (!IsAArmy(playerid)) {format(string, sizeof(string), "** %s %s: %s", RPFRN(playerid), RPN(playerid), params);}
	SendPlayerFactionMessage(playerid, 0, COLOR_ARMY, string);
	if(IsACop(playerid)) Log("logs/SAPD.log", string);
	else if(IsAGov(playerid)) Log ("logs/GOV.log", string);
    else if(IsAArmy(playerid)) Log ("logs/ARMY.log", string);
	return 1;
}



Re: Guyz Help me Please ! Epic Problem - Sandiel - 16.08.2012

Re-create the command, this time using this format:
pawn Код:
if(...)
{
     if(....)
    {
           if(..)
          {
                // So on..
          }
    }
}
For less complications


Re : Re: Guyz Help me Please ! Epic Problem - Adam_Hardy - 16.08.2012

Quote:
Originally Posted by Sandiel
Посмотреть сообщение
Re-create the command, this time using this format:
pawn Код:
if(...)
{
     if(....)
    {
           if(..)
          {
                // So on..
          }
    }
}
For less complications
can u rewrite it for me ?


Re: Guyz Help me Please ! Epic Problem - TaLhA XIV - 16.08.2012

Can you tell the lines that have errors?


Re : Re: Guyz Help me Please ! Epic Problem - Adam_Hardy - 16.08.2012

Quote:
Originally Posted by TaLhA XIV
Посмотреть сообщение
Can you tell the lines that have errors?



Re: Guyz Help me Please ! Epic Problem - TaLhA XIV - 16.08.2012

PHP код:
CMD:r(playeridparams[])
{
    new 
string[128];
       if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
IsACop(playerid) && !IsAGov(playerid) && !IsAArmy(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not an SAPD Oficer/Government Official.");
    if(
sscanf(params"s[128]"params)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: (/r)adio [text]");
    if(
AntiAdv(playeridparams)) return 1;
    if(
PlayerInfo[playerid][pFacDiv]){format(stringsizeof(string), "** [%s] %s %s: %s"RPFDN(playerid), RPFRN(playerid), RPN(playerid), params);}
    else if (!
IsACop(playerid)) {format(stringsizeof(string), "** %s %s: %s"RPFRN(playerid), RPN(playerid), params);
    
SendPlayerFactionMessage(playerid0COLOR_RADIOstring);}
    else if (!
IsAGov(playerid)) {format(stringsizeof(string), "** %s %s: %s"RPFRN(playerid), RPN(playerid), params);
    
SendPlayerFactionMessage(playerid0COLOR_GREENstring);}
    else if (!
IsAArmy(playerid)) {format(stringsizeof(string), "** %s %s: %s"RPFRN(playerid), RPN(playerid), params);
    
SendPlayerFactionMessage(playerid0COLOR_ARMYstring);}
    if(
IsACop(playerid)) Log("logs/SAPD.log"string);
    else if(
IsAGov(playerid)) Log ("logs/GOV.log"string);
    else if(
IsAArmy(playerid)) Log ("logs/ARMY.log"string);
    return 
1;

TEst this and tell me if you get any errors.


Re : Re: Guyz Help me Please ! Epic Problem - Adam_Hardy - 17.08.2012

Quote:
Originally Posted by TaLhA XIV
Посмотреть сообщение
PHP код:
CMD:r(playeridparams[])
{
    new 
string[128];
       if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
IsACop(playerid) && !IsAGov(playerid) && !IsAArmy(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not an SAPD Oficer/Government Official.");
    if(
sscanf(params"s[128]"params)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: (/r)adio [text]");
    if(
AntiAdv(playeridparams)) return 1;
    if(
PlayerInfo[playerid][pFacDiv]){format(stringsizeof(string), "** [%s] %s %s: %s"RPFDN(playerid), RPFRN(playerid), RPN(playerid), params);}
    else if (!
IsACop(playerid)) {format(stringsizeof(string), "** %s %s: %s"RPFRN(playerid), RPN(playerid), params);
    
SendPlayerFactionMessage(playerid0COLOR_RADIOstring);}
    else if (!
IsAGov(playerid)) {format(stringsizeof(string), "** %s %s: %s"RPFRN(playerid), RPN(playerid), params);
    
SendPlayerFactionMessage(playerid0COLOR_GREENstring);}
    else if (!
IsAArmy(playerid)) {format(stringsizeof(string), "** %s %s: %s"RPFRN(playerid), RPN(playerid), params);
    
SendPlayerFactionMessage(playerid0COLOR_ARMYstring);}
    if(
IsACop(playerid)) Log("logs/SAPD.log"string);
    else if(
IsAGov(playerid)) Log ("logs/GOV.log"string);
    else if(
IsAArmy(playerid)) Log ("logs/ARMY.log"string);
    return 
1;

TEst this and tell me if you get any errors.
File Compiled but it didn't work ig ! "warnings"

(988 : warning 217: loose indentation
(9889) : warning 217: loose indentation
(9894) : warning 217: loose indentation
(9896) : warning 217: loose indentation


Re: Guyz Help me Please ! Epic Problem - TaLhA XIV - 17.08.2012

Just try the ig.


Re : Guyz Help me Please ! Epic Problem - Adam_Hardy - 17.08.2012

--" wut ?


Re: Guyz Help me Please ! Epic Problem - CROSS_Hunter - 17.08.2012

pawn Код:
//under ur defines
#pragma tabsize 0