problems
#1

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(playeridparams[]) {
new 
count 0;
new 
string[256];
new 
name[MAX_PLAYER_NAME];
SendClientMessage(playeridGREEN,"  ");
SendClientMessage(playeridGREEN,"Currently online very important players (vips)");
for(new 
0MAX_PLAYERS++) {
if(
IsPlayerConnected(i)) {
GetPlayerName(inamesizeof(name));
if(
PlayerInfo[i][pVIP] >= 1) {
format(stringsizeof(string),"Donator Level - %d: %s "PlayerInfo[playerid][pVIP],name);
SendClientMessage(playeridPURPLEstring);
count++;
}
}
}
if(
count == 0) {
SendClientMessage(playeridGREEN,"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.
Reply
#2

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)