command only works for leader - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: command only works for leader (
/showthread.php?tid=253996)
command only works for leader -
stix - 08.05.2011
pawn Код:
if(strcmp(cmd,"/makeog",true)==0)
{
if(PlayerData[playerid][GSLeader] != 1 && PlayerData[playerid][SBFLeader] != 1 && PlayerData[playerid][TDFLeader] != 1 && PlayerData[playerid][IBLeader] != 1 && PlayerData[playerid][JBLeader] != 1 && PlayerData[playerid][KTBLeader] != 1 && PlayerData[playerid][VLeader] != 1 && PlayerData[playerid][VariosLeader] != 1 && PlayerData[playerid][TDBLeader] != 1 &&
PlayerData[playerid][GSco] != 1 && PlayerData[playerid][SBFco] != 1 && PlayerData[playerid][TDFco] != 1 && PlayerData[playerid][IBco] != 1 && PlayerData[playerid][JBco] != 1 && PlayerData[playerid][KTBco] != 1 && PlayerData[playerid][Vco] != 1 && PlayerData[playerid][Variosco] != 1 && PlayerData[playerid][TDBco] != 1) return SendClientMessage(playerid,ORANGE,"** You are not a Gang Leader or Co Leader!");
{
}
if(strlen(tmp) == 0) return SendClientMessage(playerid, ORANGE, "** Correct Usage - /MakeOG [ playerid ]");
{
if(PlayerData[playerid][GSLeader] == 1 && PlayerData[playerid][GSco] == 1)
{
new otherplayerid;
otherplayerid = strval(tmp);
PlayerData[otherplayerid][GSOG] = 1;
SendClientMessage(otherplayerid,ORANGE, "** You have been given Grove Street Families OG rights");
SendClientMessage(otherplayerid,ORANGE, "** Now you are able to use AK47 and Shotgun.");
return 1;
}
else if(PlayerData[playerid][SBFLeader] == 1 && PlayerData[playerid][SBFco] == 1)
{
new otherplayerid;
otherplayerid = strval(tmp);
PlayerData[otherplayerid][SBFOG] = 1;
SendClientMessage(otherplayerid,ORANGE, "** You have been given the Seville Boulevard Families OG Rights");
SendClientMessage(otherplayerid,ORANGE, "** Now you are able to use AK47 and Shotgun.");
}
else if(PlayerData[playerid][TDFLeader] == 1 && PlayerData[playerid][TDFco] == 1)
{
new otherplayerid;
otherplayerid = strval(tmp);
PlayerData[otherplayerid][TDFOG] = 1;
SendClientMessage(otherplayerid,ORANGE, "** You have been given the Temple Drive Families OG Rights");
SendClientMessage(otherplayerid,ORANGE, "** Now you are able to use AK47 and Shotgun.");
}
else if(PlayerData[playerid][IBLeader] == 1 && PlayerData[playerid][IBco] == 1)
{
new otherplayerid;
otherplayerid = strval(tmp);
PlayerData[otherplayerid][IBOG] = 1;
SendClientMessage(otherplayerid,ORANGE, "** You have been given the Front Yard Ballas OG Rights");
SendClientMessage(otherplayerid,ORANGE, "** Now you are able to use AK47 and Shotgun.");
}
else if(PlayerData[playerid][JBLeader] == 1 && PlayerData[playerid][JBco] == 1)
{
new otherplayerid;
otherplayerid = strval(tmp);
PlayerData[otherplayerid][JBOG] = 1;
SendClientMessage(otherplayerid,ORANGE, "** You have been given the Rolling Height Ballas OG Rights");
SendClientMessage(otherplayerid,ORANGE, "** Now you are able to use AK47 and Shotgun.");
}
else if(PlayerData[playerid][KTBLeader] == 1 && PlayerData[playerid][KTBco] == 1)
{
new otherplayerid;
otherplayerid = strval(tmp);
PlayerData[otherplayerid][KTBOG] = 1;
SendClientMessage(otherplayerid,ORANGE, "** You have been given the Kilo Tray Ballas OG Rights");
SendClientMessage(otherplayerid,ORANGE, "** Now you are able to use AK47 and Shotgun.");
}
else if(PlayerData[playerid][VLeader] == 1 || PlayerData[playerid][Vco] == 1)
{
new otherplayerid;
otherplayerid = strval(tmp);
PlayerData[otherplayerid][VOG] = 1;
SendClientMessage(otherplayerid,ORANGE, "** You have been given the East Beach Vagos OG Rights");
SendClientMessage(otherplayerid,ORANGE, "** Now you are able to use AK47 and Shotgun.");
}
else if(PlayerData[playerid][VariosLeader] == 1 && PlayerData[playerid][Variosco] == 1)
{
new otherplayerid;
otherplayerid = strval(tmp);
PlayerData[otherplayerid][VariosOG] = 1;
SendClientMessage(otherplayerid,ORANGE, "** You have been given the El Corona Aztecas OG Rights");
SendClientMessage(otherplayerid,ORANGE, "** Now you are able to use AK47 and Shotgun.");
}
else if(PlayerData[playerid][TDBLeader] == 1 && PlayerData[playerid][TDBco] == 1)
{
new otherplayerid;
otherplayerid = strval(tmp);
PlayerData[otherplayerid][TDBOG] = 1;
SendClientMessage(otherplayerid,ORANGE, "** You have been given the Temple Drive Ballas OG Rights");
SendClientMessage(otherplayerid,ORANGE, "** Now you are able to use AK47 and Shotgun.");
}
return 1;
}
}
Can you boys tell me why the command only works for the leader?
For the leader it works fine, but when you type it being the co leader nothing happens, no messages nothing.
Re: command only works for leader -
Hornet600 - 08.05.2011
pawn Код:
if(strcmp(cmd,"/gsco",true)==0)
{
PlayerData[playerid][GSco] = 1;
}
Re: command only works for leader -
stix - 08.05.2011
I already got a command to make players co leaders, the problem is that when a co leader wants to use /makeog, nothing happens
Re: command only works for leader -
MadeMan - 08.05.2011
pawn Код:
if(PlayerData[playerid][GSLeader] == 1 && PlayerData[playerid][GSco] == 1)
Change && to ||
pawn Код:
if(PlayerData[playerid][GSLeader] == 1 || PlayerData[playerid][GSco] == 1)
Re: command only works for leader -
stix - 08.05.2011
Already tried, still only works for leader
Re: command only works for leader -
stix - 09.05.2011
so whats the answer
Re: command only works for leader -
PotH3Ad - 09.05.2011
Try replacing this code:
pawn Код:
if(PlayerData[playerid][GSLeader] == 0 && PlayerData[playerid][GSco] == 0) return 1;
else
{
new otherplayerid;
otherplayerid = strval(tmp);
PlayerData[otherplayerid][GSOG] = 1;
SendClientMessage(otherplayerid,ORANGE, "** You have been given Grove Street Families OG rights");
SendClientMessage(otherplayerid,ORANGE, "** Now you are able to use AK47 and Shotgun.");
return 1;
}