Help with Warnings commands (+REP for help)
#1

Hello.
I have a problem , i make a faction from this showthread.php?p=2052587 <_ Tutorial
And when i compile , show this warnings :
Код:
D:\Old City RolePlay v0.1\gamemodes\U1.pwn(1150) : warning 215: expression has no effect
D:\Old City RolePlay v0.1\gamemodes\U1.pwn(1151) : warning 215: expression has no effect
D:\Old City RolePlay v0.1\gamemodes\U1.pwn(1169) : warning 215: expression has no effect
D:\Old City RolePlay v0.1\gamemodes\U1.pwn(1170) : warning 215: expression has no effect
And warning is on this code:
Код:
CMD:makeleader(playerid, params[])
{
    new targetid, factionid, string[128], targetname[24], playername[24];
    if(sscanf(params, "ui", targetid, factionid)) return SendClientMessage(playerid, -1, "Usage: /makeleader [playerid][factionid]"); //Checks if they typed in anything for the playerid and factionid parameters, and if they don't, return a client message.
    if(PlayerInfo[playerid][pAdmin] != 8) return SendClientMessage(playerid, -1, "You are not an admin"); //Checks if they are an admin.  Remember, change this to your admin variable, or use !IsPlayerAdmin to check if they aren't rcon admin.
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!"); //Sends a message if the player is not connected
    if(0 < factionid < 7) //Checks if the factionid is between 0 and 3, and if so, continue.  You can also type this like so: if(factionid >= 1 && factionid <= 2) or if(factionid == 1 || factionid == 2)
    {
        GetPlayerName(playerid, playername, sizeof(playername)); //Gets the players name and saves it to the variable playername
        GetPlayerName(targetid, targetname, sizeof(targetname)); //Gets the targets name and saves it to the variable targetname
        format(string, sizeof(string), "You made %s leader of faction id %i!", targetname, factionid); //Formats the string that you will receive
        SendClientMessage(playerid, -1, string); //Sends a message to the person who changes the other persons faction in a random color
        format(string, sizeof(string), "You were made leader of faction id %i by %s", factionid, playername);//Formats the string that the player will receive
        SendClientMessage(playerid, -1, string); 
This LINE        PlayerInfo[playerid][Faction] == factionid;
This LINE       PlayerInfo[playerid][Rank] == 6; 
    }
    else return SendClientMessage(playerid, -1, "Invalid factionid.  Factionid's: 1,2,3,4,5,6"); //Sends a message if the faction is NOT between 0 and 3
    return 1;
}
And this code:
Код:
CMD:fpk(playerid, params[])
{
    new targetid, targetname[24], playername[24], string[128]; //Create the variables
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /fpk [playerid/partofname]"); //Sends message if they do not type something in for the targetid/name
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!"); //Sends a message if the player isn't connected
    if(PlayerInfo[playerid][pAdmin] != 6 && PlayerInfo[playerid][Rank] != 6) return SendClientMessage(playerid, -1, "You are not a high enough admin or you aren't the leader!"); //Sends a message if they aren't the leader of the faction and if they aren't admin
    GetPlayerName(targetid, targetname, sizeof(targetname)); //Stores the targetid's name in the targetname variable
    GetPlayerName(playerid, playername, sizeof(playername)); //Stores the playerid's name in the playername variable
    format(string, sizeof(string), "You removed %s from his (now) previous faction!", targetname);//Formats the message that will be sent to you (the player)
    SendClientMessage(playerid, -1, string);//Sends the message that is formatted above to the playerid in a random color
    format(string, sizeof(string), "You were removed from your faction by %s!", playername);//Formats the message that will be sent to the targetid
    SendClientMessage(targetid, -1, string);//Sends the message that is formatted above to the targetid in a random color
This LINE   PlayerInfo[targetid][Faction] == 0; //Sets their faction variable to 0 
This LINE    PlayerInfo[targetid][Rank] == 0; //Sets their rank variable to 0
    return 1; 
}
Please help me and i give +REP for HELP
Reply
#2

Hello,

Try this following codes ^_^
pawn Код:
PlayerInfo[targetid][Rank] = 0; //Sets their rank variable to 0
Just remove the additional "=" In every warnings!
Reply
#3

You don't need a double = in such definition.
Reply
#4

Thanks Trynda | +rep
Thanks DaniceMcHarle |+rep
Thanks Ralfie | +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)