help with make leader cmd
#1

pawn Код:
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]");
    if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!");
    if(0 < factionid < 3)
    {
        GetPlayerName(playerid, playername, sizeof(playername));
        GetPlayerName(targetid, targetname, sizeof(targetname));
        format(string, sizeof(string), "You made %s leader of faction id %i!", targetname, factionid);
        SendClientMessage(playerid, -1, string);
        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);
        PlayerInfo[playerid][pFaction] == factionid; //1957
        PlayerInfo[playerid][pRank] == 6; //1958
    }
    else return SendClientMessage(playerid, -1, "Invalid factionid.  Factionid's: 1-2");
    return 1;
}
Код:
ers\Michael\Desktop\test\gamemodes\Wildside.pwn(1957) : warning 215: expression has no effect
C:\Users\Michael\Desktop\test\gamemodes\Wildside.pwn(1958) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#2

Dn't make == make =

If there is "if" make ==
Reply
#3

Quote:
Originally Posted by TomatoRage
Посмотреть сообщение
Dn't make == make =

If there is "if" make ==
thankyou!!!
+rep
Reply
#4

here

pawn Код:
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]");
    if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!");
    if(0 < factionid < 3)
    {
        GetPlayerName(playerid, playername, sizeof(playername));
        GetPlayerName(targetid, targetname, sizeof(targetname));
        format(string, sizeof(string), "You made %s leader of faction id %i!", targetname, factionid);
        SendClientMessage(playerid, -1, string);
        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);
        PlayerInfo[playerid][pFaction] = factionid; //1957
        PlayerInfo[playerid][pRank] = 6; //1958
    }
    else return SendClientMessage(playerid, -1, "Invalid factionid.  Factionid's: 1-2");
    return 1;
}
Reply
#5

Which lines do the warnings apply to, exactly?
Reply
#6

I believe he has already fixed the problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)