SA-MP Forums Archive
*** This topic title is not descriptive. - 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: *** This topic title is not descriptive. (/showthread.php?tid=390607)



*** This topic title is not descriptive. - Laure - 07.11.2012

Could deal with this error
Код:
D:\Xtreme Gaming Roleplay\gamemodes\xg-rp.pwn(9742) : error 001: expected token: ")", but found "-identifier-"
D:\Xtreme Gaming Roleplay\gamemodes\xg-rp.pwn(9742) : warning 215: expression has no effect
D:\Xtreme Gaming Roleplay\gamemodes\xg-rp.pwn(9742) : error 001: expected token: ";", but found "]"
D:\Xtreme Gaming Roleplay\gamemodes\xg-rp.pwn(9742) : error 029: invalid expression, assumed zero
D:\Xtreme Gaming Roleplay\gamemodes\xg-rp.pwn(9742) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Which are causing of the line
Код:
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) && !IsAFBI(playerid) && !IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction!");
	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, over.", RPFDN(playerid), RPFRN(playerid), RPN(playerid), params);}
 	if(PlayerInfo[playerid]pFac] == 1) // The only line causing problem.
	format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
	SendPlayerFactionMessage(playerid, 0, COLOR_BBLUE, string);
 	if(PlayerInfo[playerid]pFac] == 6)
	format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
	SendPlayerFactionMessage(playerid, 0, COLOR_FBIRADIO, string);
	else if(PlayerInfo[playerid]pFac] == 5)
	format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
	SendPlayerFactionMessage(playerid, 0, COLOR_MEDICC, string);
	else if(PlayerInfo[playerid]pFac] == 4)
	format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
	SendPlayerFactionMessage(playerid, 0, COLOR_ORANGE, string);
	return 1;
}



Re: Errors. - Glad2BeHere - 07.11.2012

pawn Код:
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) && !IsAFBI(playerid) && !IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction!");
    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, over.", RPFDN(playerid), RPFRN(playerid), RPN(playerid), params);
    if(PlayerInfo[playerid]pFac] == 1) // The only line causing problem.
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_BBLUE, string);
    if(PlayerInfo[playerid]pFac] == 6)
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_FBIRADIO, string);
    else if(PlayerInfo[playerid]pFac] == 5)
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_MEDICC, string);
    else if(PlayerInfo[playerid]pFac] == 4)
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_ORANGE, string);
    return 1;
}



Re: Errors. - DBan - 07.11.2012

pawn Код:
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) && !IsAFBI(playerid) && !IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction!");
    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, over.", RPFDN(playerid), RPFRN(playerid), RPN(playerid), params);}
    if(PlayerInfo[playerid][pFac] == 1) // The only line causing problem.
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_BBLUE, string);
    if(PlayerInfo[playerid][pFac] == 6)
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_FBIRADIO, string);
    else if(PlayerInfo[playerid][pFac] == 5)
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_MEDICC, string);
    else if(PlayerInfo[playerid][pFac] == 4)
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_ORANGE, string);
    return 1;
}
You have to do it like this:
pawn Код:
else if(PlayerInfo[playerid][pFac] == 4)
Instead of

pawn Код:
else if(PlayerInfo[playerid]pFac] == 4)



Re: Errors. - Laure - 07.11.2012

Both didnt help at all.


Re: Errors. - DBan - 07.11.2012

Quote:
Originally Posted by Imperor
Посмотреть сообщение
Both didnt help at all.
Removing all of your custom coding (ex. SendPlayerFactionMessage), it compiles successfully for me. What errors are you getting now?


Re: Errors. - Laure - 07.11.2012

Is the same errors as before.


Re: Errors. - Glad2BeHere - 07.11.2012

pawn Код:
stock RPFRN(playerid)
{
    new rankname[32];
    if(PlayerInfo[playerid][pFacRank] == 0 && PlayerInfo[playerid][pFac] == 0) format(rankname, sizeof(rankname), "Civilian");
    else if(PlayerInfo[playerid][pFac])
    {
        if(PlayerInfo[playerid][pFacRank] == 0) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank0]);
        else if(PlayerInfo[playerid][pFacRank] == 1) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank1]);
        else if(PlayerInfo[playerid][pFacRank] == 2) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank2]);
        else if(PlayerInfo[playerid][pFacRank] == 3) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank3]);
        else if(PlayerInfo[playerid][pFacRank] == 4) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank4]);
        else if(PlayerInfo[playerid][pFacRank] == 5) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank5]);
        else if(PlayerInfo[playerid][pFacRank] == 6) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank6]);
    }
    return rankname;
}
pawn Код:
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)) 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 {format(string, sizeof(string), "** %s %s: %s", RPFRN(playerid), RPN(playerid), params);}
    SendPlayerFactionMessage(playerid, 0, COLOR_RADIO, string);
    return 1;
}
There u go mr zgamer u should read whats rpfrn just saying


Re: Errors. - DBan - 07.11.2012

Quote:
Originally Posted by Imperor
Посмотреть сообщение
Is the same errors as before.
You shouldn't be coming up with any errors with the code I gave you, unless you messed something up not directly-related to the code you posted.


Re: Errors. - Laure - 07.11.2012

Honestly your one gave the same errors anyhow i fixed it doing something like this.
Код:
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) && !IsAFBI(playerid) && !IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction!");
    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, over.", RPFDN(playerid), RPFRN(playerid), RPN(playerid), params);}
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    if(PlayerInfo[playerid][pFac] == 1) SendPlayerFactionMessage(playerid, 0, COLOR_BBLUE, string);
    else if(PlayerInfo[playerid][pFac] == 6) SendPlayerFactionMessage(playerid, 0, COLOR_FBIRADIO, string);
    else if(PlayerInfo[playerid][pFac] == 4) SendPlayerFactionMessage(playerid, 0, COLOR_ORANGE, string);
    else if(PlayerInfo[playerid][pFac] == 5) SendPlayerFactionMessage(playerid, 0, COLOR_MEDICC, string);
    return 1;
}



Re: Errors. - Glad2BeHere - 07.11.2012

pawn Код:
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) && !IsAFBI(playerid) && !IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction!");
    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, over.", RPFDN(playerid), RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_BBLUE, string);
    }
    else if(PlayerInfo[playerid]pFac] == 1) // The only line causing problem.
    {
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_BBLUE, string);
    }
    else if(PlayerInfo[playerid]pFac] == 6)
    {
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_FBIRADIO, string);
    }
    else if(PlayerInfo[playerid]pFac] == 5)
    {
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_MEDICC, string);
    }
    else if(PlayerInfo[playerid]pFac] == 4)
    {
    format(string, sizeof(string), "** %s %s: %s, over.", RPFRN(playerid), RPN(playerid), params);
    SendPlayerFactionMessage(playerid, 0, COLOR_ORANGE, string);
    }
    return 1;
}
reason 4 ur errors is because ur a half scripter stop making custom edits and read and understand inside of just doing stuff without concern