VIP List Help -
Filbert - 10.06.2016
I made this command >
PHP код:
CMD:vips(playerid, params[])
{
SendClientMessage(playerid, green, " ");
SendClientMessage(playerid, green, "___________ |- Online VIPs -| ___________");
SendClientMessage(playerid, green, " ");
new count = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!PlayerInfo[i][VIP]) continue;
new string[90], playersname[MAX_PLAYER_NAME];
GetPlayerName(i, playersname, sizeof(playersname));
switch(PlayerInfo[i][VIP])
{
case 1: format(string, sizeof(string), "{993300}%s (ID:%i) - VIP Level: %d | Bronze VIP", playersname, i, PlayerInfo[i][VIP]);
case 2: format(string, sizeof(string), "{C0C0C0}%s (ID:%i) - VIP Level: %d | Silver VIP", playersname, i, PlayerInfo[i][VIP]);
case 3: format(string, sizeof(string), "{CCFFDD}%s (ID:%i) - VIP Level: %d | Gold VIP", playersname, i, PlayerInfo[i][VIP]);
case 4: format(string, sizeof(string), "{33CCFF}%s (ID:%i) - VIP Level: %d | Diamond VIP", playersname, i, PlayerInfo[i][VIP]);
default: continue;
}
}
SendClientMessage(playerid, red, string);
count++;
}
if(!count) SendClientMessage(playerid, red, "No VIP online in the list");
SendClientMessage(playerid, green, "______________________________________");
return 1;
}
And I found this Error >
Код:
H:\GAME\SA-MP Server\HGTDM~RP\Gamemodes\HGTDM~RP.pwn(31447) : error 017: undefined symbol "string"
H:\GAME\SA-MP Server\HGTDM~RP\Gamemodes\HGTDM~RP.pwn(31450) : error 010: invalid function or declaration
H:\GAME\SA-MP Server\HGTDM~RP\Gamemodes\HGTDM~RP.pwn(31452) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
Please Help Me To Solve This Problem...
Thanks And God Bless You All
Re: VIP List Help -
1fret - 10.06.2016
Specify the lines man gzz
Re: VIP List Help -
Filbert - 10.06.2016
Please Give Me The Right Codes
Re: VIP List Help -
Stinged - 10.06.2016
Did you actually read what I told you the last time?
http://forum.sa-mp.com/showthread.ph...01#post3714001
"never create arrays and variables inside loops"
And isn't it clear? Don't you think there's an extra bracket under default?
Re: VIP List Help -
Filbert - 10.06.2016
OK, I made this command >
PHP код:
CMD:vips(playerid, params[])
{
SendClientMessage(playerid, green, " ");
SendClientMessage(playerid, green, "___________ |- Online VIPs -| ___________");
SendClientMessage(playerid, green, " ");
new
string[90],
playersname[MAX_PLAYER_NAME],
count = 0;
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!PlayerInfo[i][VIP]) continue;
GetPlayerName(i, playersname, sizeof(playersname));
switch(PlayerInfo[i][VIP])
{
case 1: format(string, sizeof(string), "{993300}%s (ID:%i) - VIP Level: %d | Bronze VIP", playersname, i, PlayerInfo[i][VIP]);
case 2: format(string, sizeof(string), "{C0C0C0}%s (ID:%i) - VIP Level: %d | Silver VIP", playersname, i, PlayerInfo[i][VIP]);
case 3: format(string, sizeof(string), "{CCFFDD}%s (ID:%i) - VIP Level: %d | Gold VIP", playersname, i, PlayerInfo[i][VIP]);
case 4: format(string, sizeof(string), "{33CCFF}%s (ID:%i) - VIP Level: %d | Diamond VIP", playersname, i, PlayerInfo[i][VIP]);
default: continue;
}
}
SendClientMessage(playerid, red, string);
count++;
}
if(!count) SendClientMessage(playerid, red, "No VIP online in the list");
SendClientMessage(playerid, green, "______________________________________");
return 1;
}
And I found this Error >
Код:
H:\GAME\SA-MP Server\HGTDM~RP\Gamemodes\HGTDM~RP.pwn(31453) : error 010: invalid function or declaration
H:\GAME\SA-MP Server\HGTDM~RP\Gamemodes\HGTDM~RP.pwn(31455) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.