SA-MP Forums Archive
VIP Cmds. - 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 Cmds. (/showthread.php?tid=625502)



VIP Cmds. - aymane123 - 02.01.2017

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;




Respuesta: VIP Cmds. - HidroDF - 02.01.2017

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


Re: VIP Cmds. - aymane123 - 02.01.2017

Yes i just want a simple example.


Re: VIP Cmds. - RyderX - 02.01.2017

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 .


Re: VIP Cmds. - aymane123 - 02.01.2017

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




Re: VIP Cmds. - XBoss30 - 02.01.2017

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


Re: VIP Cmds. - iLearner - 02.01.2017

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.


Re: VIP Cmds. - XBoss30 - 02.01.2017

Aaah Yea!


Re: VIP Cmds. - RyderX - 02.01.2017

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;




Re: VIP Cmds. - J0sh... - 02.01.2017

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;