PDA

View Full Version : help with gang menu


blackturbo
06/07/2014, 04:44 PM
Hi all,

Ive made a gang menu for my servers that has a few bugs. Like the code Ive will post below belongs to the SU gang members. This command is suppose to show you only online SU members, but theres a bug in it, and it will show new, non registered members as well as SU members. Can somewon see something wrong in my code and help me out? I might even have a reward :) thanks.

BlackTurbo

the code is below, this is my first time entering pwn code in the forum so forgive if I did something wrong.

CMD:sumembers(playerid,params[])
{
#pragma unused params
new count = 0;
new string[128];
new ChangeColor;
new SUR[128];
SendClientMessage(playerid, red, " ");
SendClientMessage(playerid, blue, "___________ |- Online SU members -| ___________");
SendClientMessage(playerid, red, " ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid,red,"ERROR: You need to be Logged in to use this command");
if(PlayerInfo[i][SU] >= 1)
{
if(PlayerInfo[i][SU] > 7)
{
SUR = "Leader";
ChangeColor = red;
}
else
{
switch(PlayerInfo[i][SU])
{
case 1: {
SUR = "RANK 1";
ChangeColor = blue;
}
case 2: {
SUR = "RANK 2";
ChangeColor = blue;
}
case 3: {
SUR = "RANK 3";
ChangeColor = blue;
}
case 4: {
SUR = "RANK 4";
ChangeColor = blue;
}
case 5: {
SUR = "RANK 5";
ChangeColor = blue;
}
case 6: {
SUR = "RANK 6";
ChangeColor = blue;
}
case 7:{
SUR = "RANK 7";
ChangeColor = blue;
}
}
}
format(string, 128, "Rank: %d - %s (Id:%i) | %s |",PlayerInfo[i][SU], PlayerName2(i),i,SUR);
SendClientMessage(playerid, ChangeColor, string);
count++;
}
}
}
if (count == 0)
SendClientMessage(playerid,red,"No online SU members");
SendClientMessage(playerid, blue, " _______________________________________");
return 1;
}

AiRaLoKa
06/07/2014, 10:25 PM
hope it help

CMD:sumembers(playerid,params[])
{
#pragma unused params
new count = 0;
new string[128];
new ChangeColor;
new SUR[128];
if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid,red,"ERROR: You need to be Logged in to use this command");
SendClientMessage(playerid, red, " ");
SendClientMessage(playerid, blue, "___________ |- Online SU members -| ___________");
SendClientMessage(playerid, red, " ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][LoggedIn] == 0) continue;
if(PlayerInfo[i][SU] == 0) continue;

if(PlayerInfo[i][SU] > 7)
{
SUR = "Leader";
ChangeColor = red;
}
else
{
ChangeColor = blue;
switch(PlayerInfo[i][SU])
{
case 1..7:
{
format(SUR, sizeof(SUR),"RANK %d", PlayerInfo[i][SU]);
}
}
}
format(string, 128, "Rank: %d - %s (Id:%i) | %s |",PlayerInfo[i][SU], PlayerName2(i),i,SUR);
SendClientMessage(playerid, ChangeColor, string);
count++;
}
if (count == 0) SendClientMessage(playerid,red,"No online SU members");
SendClientMessage(playerid, blue, " _______________________________________");
return 1;
}

blackturbo
07/07/2014, 01:19 AM
thank you very much :) i will give it a try and let you know tommorrow.

blackturbo
07/07/2014, 01:21 PM
thanks, it works perfectly. contact me for free VIP :) thanks again!!