Vip not showing command
#1

Help.
the commad look like a clean up chat command.
not showing the commands.


PHP код:
stock VipName(playerid)
{
    new 
StringLevel[128];
    switch(
Pinfo[playerid][VipLevel])
    {
        case 
1StringLevel "Vip";
        case 
2StringLevel "Silver-Vip";
        case 
3StringLevel "Gold-Vip";
        case 
4StringLevel "Vip-Manager";
        case 
5StringLevel "Vip-Co-Owner";
        case 
6StringLevel "Vip-Owner";
    }
    return 
StringLevel;
}
COMMAND:vips(playeridparams[])
{
    
#pragma unused params
    
new Count;
    new 
str[45];
    
SendClientMessage(playerid, -1"Vip online:");
    for(new 
0MAX_PLAYERS++)
    {
        if(
Pinfo[playerid][VipLevel] >= 1)
        {
            
Count ++;
            
format(strsizeof str"%s %s"VipName(i));
            
SendClientMessage(playerid, -1str);
        }
    }
    if(
Count 1SendClientMessage(playerid, -1"No Vip Online!");
    
// Let the server know that this was a valid command
    
return 1;

Reply
#2

Here's your problem:

pawn Код:
case 1: StringLevel = "Vip";
case 2: StringLevel = "Silver-Vip";
case 3: StringLevel = "Gold-Vip";
case 4: StringLevel = "Vip-Manager";
case 5: StringLevel = "Vip-Co-Owner";
case 6: StringLevel = "Vip-Owner";
StringLevel isn't a integer variable. It's a string variable. You should do like this.

pawn Код:
case 2: format(StringLevel, sizeof(StringLevel), "Silver-Vip");
Reply
#3

False. That works perfectly fine. Also don't use format if you need to copy strings.

The real problem is this:
pawn Код:
if(Pinfo[playerid][VipLevel] >= 1)
That should be:
pawn Код:
if(Pinfo[i][VipLevel] >= 1)
Reply
#4

Oh, i didn't read his problem. Just looked at his Scripts ^^
Reply
#5

Thanks,it work.
Reply
#6

i need to,get the player name.
Sorry for Posting.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)