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;
}