Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Help me with this, +rep if done.

$
0
0
When i use /getgift in-game it says server unknown command. Also i need someone to modify as such that it's also gonna show how much time is left for the player to get a gift again.

Code:

#include<a_samp>
#include<zcmd>

new Random;

public OnFilterScriptInit()
{
      return 1;
}

public OnFilterScriptExit()
{
      return 1;
}

COMMAND:Getgift(playerid, params[])
{
   
    {
            Random = random(3);
            switch(Random)
            {
                  case 0:
                  {
                          GivePlayerMoney(playerid, 200);
                          SendClientMessage(playerid, -1, "You opened a give and received $200.");
                  }
                  case 1:
                  {
                          GivePlayerMoney(playerid, 500);
                          SendClientMessage(playerid, -1, "You opened a gift and received $500");
                  }
                  case 2:
                  {      SetPlayerScore(playerid, GetPlayerScore(playerid)+2);
                          SendClientMessage(playerid, -1, "You opened a gift and received score.");
                  }
            }
           
    }
      SetTimerEx("EndGetgift", 10800000, true, "i", playerid);
    return 1;
}
forward EndGetgift(playerid);
 

public EndGetgift(playerid)
{

    return 1;
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>