drug timer help
#1

Hey guys/ I've made a drug system. But My timer doesnt works on it
I want that you get the drugs after the 60 secs

And if the timer is started you can't do /drugsmission till the timer stops
How? XD

Please help

this is the script

Код:
if(strcmp(cmd, "/drugsmission", true) == 0)

	if(IsPlayerInRangeOfPoint(playerid, 7.0, -572.7808,-1498.3749,9.5741))
	
{
  SetTimer("drug",60000,true);
  PlayerInfo[playerid][Drugs]++;
  SetTimer("drug",60000,false);


	return 1;
	}
Reply
#2

global variable
pawn Код:
new mission;
ongamemodeinit
pawn Код:
mission = 0;
pawn Код:
if(strcmp(cmd, "/drugsmission", true) == 0) {
if(mission == 1) return SendClientMessage(playerid, color, "Mission is already started ");
else
    if(IsPlayerInRangeOfPoint(playerid, 7.0, -572.7808,-1498.3749,9.5741))
   
{
  PlayerInfo[playerid][Drugs]++;
  SetTimer("drug",60000,false);
  mission = 1;
    return 1;
    }
pawn Код:
forward drug();
public drug()
{
mission = 0;
}
Reply
#3

Thanks saif. It works great. Btw. can you help me with a deal system :P ?
Like /deal [playerid] [drugsamount] [price] ?

I really need it for my RPG server. It must be like
PlayerInfo[playerid][Drugs]++;
and
PlayerInfo[playerid][Drugs]--;


Please help

Thanks again
Reply
#4

Quote:
Originally Posted by bartje01
Thanks saif. It works great. Btw. can you help me with a deal system :P ?
Like /deal [playerid] [drugsamount] [price] ?

I really need it for my RPG server. It must be like
PlayerInfo[playerid][Drugs]++;
and
PlayerInfo[playerid][Drugs]--;


Please help

Thanks again
btw its not script request thread.Post that in script request thread Click Me
Reply
#5

ok thanks. But I don't think I gonna get helped there
I asked many things there
Reply
#6

Quote:
Originally Posted by bartje01
ok thanks. But I don't think I gonna get helped there
I asked many things there
ok i will do it for you but here what do you mean by price ?

/deal [playerid] [drugsamount] [price]
Reply
#7

AWesome saif.
Well.
The price of how much it costs.

/deal (playerid) (drugsamount) (price of the drugs that the other person has to pay)
Reply
#8

Quote:
Originally Posted by bartje01
AWesome saif.
Well.
The price of how much it costs.

/deal (playerid) (drugsamount) (price of the drugs that the other person has to pay)
i did only /deal (playerid) (drugsamount)

the other that can be abused that`s why i didnt add it .

Код:
	if (strcmp("/deal", cmdtext, true, 10) == 0)
	{
	new tmp[256];
	new tmp2[256];
	new player1 = strval(tmp);
	new drugsamount = strval(tmp2);
	if(!strlen(tmp)) return SendClientMessage(playerid, color, "USAGE : /deal [playerid] [drugsamount]");
	else
	if(!strlen(tmp2)) return SendClientMessage(playerid, color, "USAGE : /deal [playerid] [drugsamount]");
	else
	if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, color, "Error : player is not connected.");
	else
	SetPlayerDrunkLevel(player1, drugsamount);
		return 1;
	}
Reply
#9

Alright thanks mate
Reply
#10

didn;t work
When I do /deal it says /deal playerid drugsamount
But when I do:
/deal 1 1 it says wrong command.
And if it works it shouldn't do this I think
PlayerInfo[playerid][Drugs]++;
PlayerInfo[playerid][Drugs]--;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)