Bought object? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bought object? (
/showthread.php?tid=422900)
Bought object? -
davve95 - 15.03.2013
Hi!
How can I prevent to use a thing/function that I haven't "bought"..
I have to buy it before I can use that function...
Sorry, damn hard to explain ^^ ...
I hope this was the right place to post it...
As I'm not full sure because I didn't post any code, I'm not full sure if u will need?..
It's in a dialog I need it..
Thanks!.
Re: Bought object? -
DiGiTaL_AnGeL - 15.03.2013
Using conditions? (if/else)
So with "buy function" you mean you can buy it ingame?
Do you have a variable for "bought"
Re: Bought object? -
davve95 - 15.03.2013
Quote:
Originally Posted by DiGiTaL_AnGeL
Using conditions? (if/else)
So with "buy function" you mean you can buy it ingame?
Do you have a variable for "bought"
|
Yeah, buy ingame (game money)..
Variable? I don't know but I don't think so...
Re: Bought object? -
DiGiTaL_AnGeL - 15.03.2013
Show me the command for buying objects and I'll tell you if you use any variable.
Re: Bought object? -
Jstylezzz - 15.03.2013
You would have to do something like this
pawn Код:
new cigarettes[MAX_PLAYERS];
CMD:cigarettes(playerid,params[])
{
if(cigarettes[playerid] < 1) return SendClientMessage(playerid,-1,"You don't have any cigarettes");
//other code here
return 1;
}
CMD:buycigarettes(playerid,params[])
{
if(cigarettes[playerid] == 10) return SendClientMessage(playerid,-1,"You already have 10 cigarettes");
cigarettes[playerid] = 10;
return 1;
}
If you understand what I mean..
Re: Bought object? -
davve95 - 15.03.2013
Quote:
Originally Posted by Jari_Johnson*
You would have to do something like this
pawn Код:
new cigarettes[MAX_PLAYERS];
CMD:cigarettes(playerid,params[]) { if(cigarettes[playerid] < 1) return SendClientMessage(playerid,-1,"You don't have any cigarettes"); //other code here return 1; }
CMD:buycigarettes(playerid,params[]) { if(cigarettes[playerid] == 10) return SendClientMessage(playerid,-1,"You already have 10 cigarettes"); cigarettes[playerid] = 10; return 1; }
If you understand what I mean..
|
I see! Thanks alot!...
Thanks to both.