VIP Cmds.
#1

I am trying to make a cmds for this vip system but i dont know how so any help i just got the command to make vip here is it:
PHP код:
COMMAND:makevip(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid))
        return 
0;
    
    new 
otherIDvalue;
    if(
sscanf(params"ud"otherIDvalue))
    {
        
Usage(playerid"makevip <playerid> <level>");
    }
    else
    {
        if(!
isConnected(otherID))
        {
            
Server(playerid"That player isn't logged in!");
            return 
1;
        }
        switch(
value)
        {
            case 
1:
            {
                
Player[otherID][vipLevel]     = 1;
                
Player[otherID][vipExpires]    = gettime() + 2592000;
                
showAchievements(otherID"Congratulation, you're VIP now."50000);
            }
            case 
2:
            {
                
Player[otherID][vipLevel]     = 2;
                
Player[otherID][vipExpires]    = gettime() + 2592000;
                
showAchievements(otherID"Congratulation, you're VIP now."50000);
            }
            case 
3:
            {
                
Player[otherID][vipLevel]     = 3;
                
Player[otherID][vipExpires]    = gettime() + 2592000;
                
showAchievements(otherID"Congratulation, you're VIP now."50000);
            }
            default:
            {
                
Server(playerid"Please input between 1 - 3.");
            }
        }
        
saveStats(otherID);
    }
    return 
1;

Reply
#2

What is exactly what you want? Do commands for VIP members or what?
Reply
#3

Yes i just want a simple example.
Reply
#4

PHP код:
CMD:weapon(playerid,params[])
{
     If(
Player[playerid][vipLevel] >= 1)
     {
     
GivePlayerWeapon(playerid24500);
     }
     else
     {
           
SendClientMessage(playerid0xF8F8F8FFF,"[ERROR]: you need to be VIP at-least to use this CMD.");
     }

For Example .
Reply
#5

I know that i am nub in scripting but did u forget ??
PHP код:
    return 1;

Reply
#6

Quote:
Originally Posted by aymane123
Посмотреть сообщение
I know that i am nub in scripting but did u forget ??
PHP код:
    return 1;

Since his returning it using "else", you don't need to "return 1",
Example:

return 1; will show up the default thing "Server: Unknown command"

else will show "[ERROR]: you need to be VIP at-least to use this CMD."

Am I saying this properly? Can you understand
Reply
#7

His cmd will work but server would send him the unknown command message anyway. Aym is right... You need return 1; at the end to let server recognize the cmd.
Reply
#8

Aaah Yea!
Reply
#9

Uhhh, im sorry i wrote it faster :}

here it is again,

PHP код:
CMD:weapon(playerid,params[])
{
     if(
Player[playerid][vipLevel] >= 1)
     {
     
GivePlayerWeapon(playerid24500);
     }
     else
     {
           
SendClientMessage(playerid0xF8F8F8FFF,"[ERROR]: you need to be VIP at-least to use this CMD.");
     }
     return 
1;

Reply
#10

Or you could just do
PHP код:
CMD:weapon(playeridparams[]) {
    if(
Player[playerid][vipLevel] < 1) return SendClientMessage(playerid0xF8F8F8FFF,"[ERROR]: you need to be VIP at-least to use this CMD.");
    
GivePlayerWeapon(playerid24500);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)