Timer Help
#1

hey I have this command
PHP код:
CMD:setvip(playeridparams[])
{
    new 
giveplayeridmoneys1giveplayer[25], playername[25], string[256];
    if (
adlvl[playerid] < 6) return 0;
    if (
sscanf(params"ud"giveplayeridmoneys1)) return SendClientMessage2(playeridCOLOR_WHITE"Usage: /setvip [playerid] [level 1-2]");
    if (!
IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playeridCOLOR_RED"Error: Inactive player id!");
    if (
moneys1 || moneys1 2) return SendClientMessage2(playeridCOLOR_RED"Error: Invalid Vip level.");
    if (
Logged[giveplayerid] == 0) return SendClientMessage2(playeridCOLOR_WHITE"Error: Player isn't logged in.");
    
GetPlayerName(giveplayeridgiveplayerMAX_PLAYER_NAME);
    if (
adlvl[giveplayerid] >= adlvl[playerid] && adlvl[playerid] != 6) return SendPlayerFormattedText(playeridCOLOR_RED"Error: You cannot Make vip %s"giveplayer"");
    
GetPlayerName(giveplayeridgiveplayerMAX_PLAYER_NAME);
    if (
moneys1 == vipmember[giveplayerid])
    {
        
format(string64"%s is already Vip  L%d."giveplayermoneys1);
        
SendClientMessage2(playeridCOLOR_WHITEstring);
        return 
1;
    }
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    if (
moneys1 != 0)
    {
        
dini_IntSet(AddDirFile(dir_userfilesgiveplayer), "vip"moneys1);
        
dini_IntSet(AddDirFile(dir_datafilesFILE_VIPLIST), giveplayermoneys1);
        
dini_IntSet(AddDirFile(dir_userfilesgiveplayer), "pskin", -1);
    }
    else
    {
        
dini_Unset(AddDirFile(dir_userfilesgiveplayer), "vip");
        
dini_Unset(AddDirFile(dir_userfilesgiveplayer), "pskin");
        
dini_Unset(AddDirFile(dir_datafilesFILE_VIPLIST), giveplayer);
        
dini_Set(AddDirFile(dir_userfilesgiveplayer), "ChatColor""FFFFFF");
        if (
giveplayerid != playerid)
        {
            
SendClientMessage2(giveplayeridCOLOR_WHITE"Your VIP status has been removed.");
            
SendPlayerFormattedText(playeridCOLOR_YELLOW"You have removed %s's VIP status."giveplayer"");
        }
        else 
SendClientMessage2(playeridCOLOR_WHITE"You have removed your VIP status.");
    }
    
vipmember[giveplayerid] = moneys1;
    
format(string64"You have been set as Vip L%d."moneys1);
    
SendClientMessage2(giveplayeridCOLOR_YELLOWstring);
    
format(string64"You have set %s as Vip L%d."giveplayermoneys1);
    
SendClientMessage2(playeridCOLOR_YELLOWstring);
    if (
moneys1 == 1)
    {
        
GivePlayerMoney(giveplayeridGetPlayerMoney(giveplayerid)+1000000);
        if (
giveplayerid != playerid)
        {
            
SendClientMessage2(giveplayeridCOLOR_YELLOW"You have been set as a VIP member Level 1.");
            
SendPlayerFormattedText(playeridCOLOR_YELLOW"You have set %s as a VIP member Level 1."giveplayer"");
        }
        else 
SendClientMessage2(playeridCOLOR_YELLOW"You have set yourself as a VIP member Level 1.");
        return 
1;
    }
    if (
moneys1 == 2)
    {
           
GivePlayerMoney(giveplayeridGetPlayerMoney(giveplayerid)+2000000);
        if (
giveplayerid != playerid)
        {
            
SendClientMessage2(giveplayeridCOLOR_YELLOW"You have been set as a VIP member Level 2.");                SendPlayerFormattedText(playeridCOLOR_YELLOW"You have set %s as a VIP member Level 2."giveplayer"");
        }
        else 
SendClientMessage2(playeridCOLOR_YELLOW"You have set yourself as a VIP member Level 2.");
        return 
1;
        }
    return 
1;

I want it to be /setvip id lvl months
and saves the time in his file how to make it like that?
Reply
#2

This is not a section for requests, if you want adjustments to be made on your scripts, you should learn scritping or hire someone
Reply
#3

who said adjustment I said cause idk how to make I wanna know how to make I but exception if ur blind -_-
Reply
#4

Quote:
Originally Posted by silverms
Посмотреть сообщение
who said adjustment I said cause idk how to make I wanna know how to make I but exception if ur blind -_-
but basically you are asking for script.
Reply
#5

no just the way it should be like if I made it 2 month it save it in his file like something and when he join it starts --
Reply
#6

Troydere's Kitchen

Today's Lesson: Cooking a new parameter for the /setvip command with the chef Troydere!
  1. Ingredients
    • A new variable with your preferred name
    • A new value in your player data enum to save the VIP time
    • A little bit of knowledge
    • Magical powder from a fairy's vagina
  2. Directions
    • Put your new variable along with the other ones you've (implying you made that command) created
    • Add this new variable to a integer parameter in the sscanf function (with "i")
    • Make a calculation to transform seconds to months. (yourVar * 2592000)
    • Check if the guy is not VIP already checking if the actual gettime() is higher than his gettime() enum variable
    • If he is not VIP reset his vip time variable and add the gettime() value to his variable plus the value of the var you've created for the command
    • Save the value as you do with the other player data
    • Cook for 40 min at 120 C
    • Retrieve from oven
Tasty!
Reply
#7

Quote:
Originally Posted by Troydere
Посмотреть сообщение
Troydere's Kitchen...
Even though that's not how I would've done it, I love your post. This is how everyone should help people out. You actually explained and walked him through it so he will actually learn from it (if he's not still too lazy to put it in code that is). Well played.
Reply
#8

Quote:
Originally Posted by Troydere
Посмотреть сообщение
Troydere's Kitchen

Today's Lesson: Cooking a new parameter for the /setvip command with the chef Troydere!
  1. Ingredients
    • A new variable with your preferred name
    • A new value in your player data enum to save the VIP time
    • A little bit of knowledge
    • Magical powder from a fairy's vagina
  2. Directions
    • Put your new variable along with the other ones you've (implying you made that command) created
    • Add this new variable to a integer parameter in the sscanf function (with "i")
    • Make a calculation to transform seconds to months. (yourVar * 2592000)
    • Check if the guy is not VIP already checking if the actual gettime() is higher than his gettime() enum variable
    • If he is not VIP reset his vip time variable and add the gettime() value to his variable plus the value of the var you've created for the command
    • Save the value as you do with the other player data
    • Cook for 40 min at 120 C
    • Retrieve from oven
Tasty!
OMFG I think I'm actually pissing
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)