problems - 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: problems (
/showthread.php?tid=551358)
problems -
Jhony_Blaze - 18.12.2014
I got this /vips command where the player can check the vips but for some reason, when the list shows up, it shows that everyone has vip level 3 (which is the maximum level) even tho I gave them only level 1 or 2. What's the problem ? Here is the command :
PHP код:
CMD:vips(playerid, params[]) {
new count = 0;
new string[256];
new name[MAX_PLAYER_NAME];
SendClientMessage(playerid, GREEN," ");
SendClientMessage(playerid, GREEN,"Currently online very important players (vips)");
for(new i = 0; i < MAX_PLAYERS; i ++) {
if(IsPlayerConnected(i)) {
GetPlayerName(i, name, sizeof(name));
if(PlayerInfo[i][pVIP] >= 1) {
format(string, sizeof(string),"Donator Level - %d: %s ", PlayerInfo[playerid][pVIP],name);
SendClientMessage(playerid, PURPLE, string);
count++;
}
}
}
if(count == 0) {
SendClientMessage(playerid, GREEN,"No vips online right now");
}
return 1;
}
I don't really know what can be done because I am not getting any errors when compiling the script.
Re: problems -
JeaSon - 18.12.2014
you are showing playerid level
use this
pawn Код:
CMD:vips(playerid, params[]) {
new count = 0;
new string[256];
new name[MAX_PLAYER_NAME];
SendClientMessage(playerid, GREEN," ");
SendClientMessage(playerid, GREEN,"Currently online very important players (vips)");
for(new i = 0; i < MAX_PLAYERS; i ++) {
if(IsPlayerConnected(i)) {
GetPlayerName(i, name, sizeof(name));
if(PlayerInfo[i][pVIP] >= 1) {
format(string, sizeof(string),"Donator Level - %d: %s ", PlayerInfo[i][pVIP],name);
SendClientMessage(playerid, PURPLE, string);
count++;
}
}
}
if(count == 0) {
SendClientMessage(playerid, GREEN,"No vips online right now");
}
return 1;
}