Posts: 525
Threads: 158
Joined: Apr 2012
Reputation:
0
I need a cmd for drugs
Like you will get $50 per gram.
And you have to type /selldrugs [grams]
If you type /selldrugs 2 so you will get 100k
and if you type /selldrugs 1 so you will get 50k
and if you type /selldrugs 4 so you will get 200k
and so on.
something like this. someone ?
Posts: 228
Threads: 25
Joined: Jan 2015
Reputation:
0
Okay..
Firstly...
You said * $50 per gram..
Yet you want them to get 100k == $100,000...
Make your mind up.
Secondly..
It's not that hard..
Just make an if statement to +50,000 each time
Example
for example....
new money = 50000;
/selldrugs [playerid] [grams]
money *= grams;
giveplayermoney(playerid, money);
Posts: 525
Threads: 158
Joined: Apr 2012
Reputation:
0
oops i mean,
And you have to type /selldrugs [grams]
If you type /selldrugs 2 so you will get $100
and if you type /selldrugs 1 so you will get $50
and if you type /selldrugs 4 so you will get $200
Well. i m asking here cuz i want the code. not just tell me what to do. Thanks!
Posts: 1,276
Threads: 6
Joined: Aug 2014
PHP код:
CMD:selldrugs(playerid, params[])
{
new grams;
if(sscanf(params, "i", grams)) return SCM(playerid, -1, "/selldrugs [grams]");
switch(grams)
{
case ..: code
deafult: SCM(playerid, -1, "/selldrugs [grams]");
}
return 1;
}
#define SCM SendClientMessage
Posts: 525
Threads: 158
Joined: Apr 2012
Reputation:
0
I know how to make cmd but im just confused about that function where you can sell 1 gram and get $50. and 2 grams $100. I want that function. Anyone?
Posts: 1,045
Threads: 150
Joined: Oct 2013
Reputation:
0
Check if the player has the amount of grams in an "if" statement and continue everything from there.
Posts: 525
Threads: 158
Joined: Apr 2012
Reputation:
0
As i said i know how does it work but i have no any idea about codes . I want to see some codes here of function.
Like if player sells 1 grams so give him $50 or if he sells 2 grams so give him $100. I want this function.