help with make leader cmd - 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: help with make leader cmd (
/showthread.php?tid=431010)
help with make leader cmd -
Michael_Cuellar - 16.04.2013
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.
Re: help with make leader cmd -
TomatoRage - 16.04.2013
Dn't make == make =
If there is "if" make ==
Re: help with make leader cmd -
Michael_Cuellar - 16.04.2013
Quote:
Originally Posted by TomatoRage
Dn't make == make =
If there is "if" make ==
|
thankyou!!!
+rep
Re : help with make leader cmd -
DaTa[X] - 16.04.2013
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;
}
Re: help with make leader cmd -
Sithis - 16.04.2013
Which lines do the warnings apply to, exactly?
Re: help with make leader cmd -
Syntax - 16.04.2013
I believe he has already fixed the problem.