SA-MP Forums Archive
Vip not showing command - 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: Vip not showing command (/showthread.php?tid=428680)



Vip not showing command - DerickClark - 06.04.2013

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;




AW: Vip not showing command - Skimmer - 06.04.2013

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");



Re: Vip not showing command - Vince - 06.04.2013

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)



AW: Vip not showing command - Skimmer - 06.04.2013

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


Re: Vip not showing command - DerickClark - 06.04.2013

Thanks,it work.


Re: Vip not showing command - DerickClark - 06.04.2013

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