Bought object?
#1

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!.
Reply
#2

Using conditions? (if/else)
So with "buy function" you mean you can buy it ingame?
Do you have a variable for "bought"
Reply
#3

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...
Reply
#4

Show me the command for buying objects and I'll tell you if you use any variable.
Reply
#5

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..
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)