06.07.2014, 16:44
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.
CMDumembers(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;
}
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.
CMDumembers(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;
}