13.12.2013, 13:20
Can you please help me make a store area when I can buy weapons in a specified area or place just like in counter strike? I don't know which callback should I use to detect area.
CMD:buygun(playerid,params[]) //the command to enter { //opening bracket if the cmd was right if(IsPlayerInRangePoint(playerid, range, X, Y, Y) return SendClientMessage(playerid, -1, "You are not at the place to buy gun!"); //if the player is not in range of the specified position, he will get an error message! ShowPlayerDialog(playerid, 999,DIALOG_STYLE_LIST,"Guns","Buy Guns! \nDeagle $5000 \nM4 $1000","OK","No thx"); //if the player is in range of the point, it shows them the dialog return 1; //return for our dialog! } //closing bracket //this was just an example!
Use IsPlayerInrangeOfPoint
For Example code: Код:
CMD:buygun(playerid,params[]) //the command to enter { //opening bracket if the cmd was right if(IsPlayerInRangePoint(playerid, range, X, Y, Y) return SendClientMessage(playerid, -1, "You are not at the place to buy gun!"); //if the player is not in range of the specified position, he will get an error message! ShowPlayerDialog(playerid, 999,DIALOG_STYLE_LIST,"Guns","Buy Guns! \nDeagle $5000 \nM4 $1000","OK","No thx"); //if the player is in range of the point, it shows them the dialog return 1; //return for our dialog! } //closing bracket //this was just an example! |
if(IsPlayerInRangePoint(playerid, range, X, Y, Y) return SendClientMessage(playerid, -1, "You are not at the place to buy gun!");//this if the player in range of the floats he will get an error message.
if(!IsPlayerInRangePoint(playerid, range, X, Y, Y) return SendClientMessage(playerid, -1, "You are not at the place to buy gun!");//this if the player not in range of the point!
thanks and is there any filterscript to detect if IsPlayerInRangeofPoint that I can use ingame? You know it's kinda bit difficult for me to guess the size. I need a rectangular size just like the base of counter terrorist in de_dust map.
Edit: Thanks for the fast reply guys really appreciate. lol that's why his name is Viper. Dodge Viper lolol |
if(IsPlayerInRangeOfPoint(playerid, 50.0, X, Y, Z))
thanks and is there any filterscript to detect if IsPlayerInRangeofPoint that I can use ingame? You know it's kinda bit difficult for me to guess the size. I need a rectangular size just like the base of counter terrorist in de_dust map. and for the terrorist base I think it's like a square.
Edit: Thanks for the fast reply guys really appreciate. lol that's why his name is Viper. Dodge Viper lolol |