Need help with /vips command
#1

Me and my friends are making a server in strcmp and i wanted to make a /vips command that's the same as the /admins command but shows all the online vips instead of admins. Can anyone supply me with the command? If u cant help me with this command can u at least send me a /admins command?
Reply
#2

Yeah, we need to see your code so we can have an ideea what we are dealing with here.

If you make like pInfo[playerid][pRank] or something ... Just change the ADMIN rank to VIP rank or something ?

This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds. Insane O.o
Reply
#3

What part of the code do u need?
when i make a code for vip only i use
Код:
if(IsPlayerVipType(playerid,1))
the one at the end is vip level 1 (vip silver)
level 2 = vip gold
level 3 = vip premium
Reply
#4

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/vips"true) == 0)
    {
        new 
str[128];
        for(new 
0MAX_PLAYERS++)
        {
            if(!
IsPlayerConnected(i)) continue;
            
GetPlayerName(istr24);
            if(
IsPlayerVipType(i,1)) { format(strsizeof str">> %s [ID %d] - VIP Silver"stri); }
            else if(
IsPlayerVipType(i,2)) { format(strsizeof str">> %s [ID %d] - VIP Gold"stri); }
            else if(
IsPlayerVipType(i,3)) { format(strsizeof str">> %s [ID %d] - VIP Premium"stri); }
            else continue;
            
SendClientMessage(playerid0xFFFF00FFstr);
        }
        return 
1;
    }
    return 
0;

Reply
#5

Quote:
Originally Posted by Shadoww5
Посмотреть сообщение
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/vips"true) == 0)
    {
        new 
str[128];
        for(new 
0MAX_PLAYERS++)
        {
            if(!
IsPlayerConnected(i)) continue;
            
GetPlayerName(istr24);
            if(
IsPlayerVipType(i,1)) { format(strsizeof str">> %s [ID %d] - VIP Silver"stri); }
            else if(
IsPlayerVipType(i,2)) { format(strsizeof str">> %s [ID %d] - VIP Gold"stri); }
            else if(
IsPlayerVipType(i,3)) { format(strsizeof str">> %s [ID %d] - VIP Premium"stri); }
            else continue;
            
SendClientMessage(playerid0xFFFF00FFstr);
        }
        return 
1;
    }
    return 
0;

now i get this error

Код:
C:\Users\Aleksandar\Desktop\Samp Stuff\Server\gamemodes\FreeRoam.pwn(1827) : error 029: invalid expression, assumed zero
C:\Users\Aleksandar\Desktop\Samp Stuff\Server\gamemodes\FreeRoam.pwn(1827) : error 029: invalid expression, assumed zero
C:\Users\Aleksandar\Desktop\Samp Stuff\Server\gamemodes\FreeRoam.pwn(1846) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#6

can someone please help, if u cant help me with this command can u at least send me a /admins command?
Reply
#7

READ THIS BEFORE POSTING! (RULES TO FOLLOW)

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/vips", true) == 0)
    {
        new str[128];
        for(new i = 0; i < MAX_PLAYERS; i ++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerName(i, str, 24);
                if(IsPlayerVipType(i,1)) format(str, sizeof str, ">> %s [ID %d] - VIP Silver", str, i);
                if(IsPlayerVipType(i,2)) format(str, sizeof str, ">> %s [ID %d] - VIP Gold", str, i);
                if(IsPlayerVipType(i,3)) format(str, sizeof str, ">> %s [ID %d] - VIP Premium", str, i);
                SendClientMessage(playerid, 0xFFFF00FF, str);
            }
        }
        return 1;
    }
    return 0;
}
Reply
#8

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
READ THIS BEFORE POSTING! (RULES TO FOLLOW)

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/vips", true) == 0)
    {
        new str[128];
        for(new i = 0; i < MAX_PLAYERS; i ++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerName(i, str, 24);
                if(IsPlayerVipType(i,1)) format(str, sizeof str, ">> %s [ID %d] - VIP Silver", str, i);
                if(IsPlayerVipType(i,2)) format(str, sizeof str, ">> %s [ID %d] - VIP Gold", str, i);
                if(IsPlayerVipType(i,3)) format(str, sizeof str, ">> %s [ID %d] - VIP Premium", str, i);
                SendClientMessage(playerid, 0xFFFF00FF, str);
            }
        }
        return 1;
    }
    return 0;
}
That's the exact same code the other showed me. Learn to actually help others not copy and paste what other people say just so you can have more posts
Reply
#9

Quote:
Originally Posted by Aleks1337
Посмотреть сообщение
That's the exact same code the other showed me. Learn to actually help others not copy and paste what other people say just so you can have more posts
Learn before posting
https://sampwiki.blast.hk/wiki/Control_Structures#else_if
Reply
#10

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
Dude, is the real reason you keep posting is because you wanna leech post? come on now?Please do not spam. How about this! Solve his, I don't see him doing anything wrong with his post. Sure he could of posted in Scripting Request but he seems to have more problem. This isn't a request its asking for help. He wants to know how he could do it like /admins but /vip.

Also when you tell someone to reason something about Learn before posting, you might actually wanna tell them what to learn.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)