little help
#1

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

Use a timer with a loop for each player and IsPlayerInRangeOfPoint
Or make a checkpoint/pickup and use OnPlayerEnterCheckPoint/OnPlayerPickupPickUp ( I suggest using streamer if you're going to use this )
Reply
#3

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/Dialog_Styles
https://sampwiki.blast.hk/wiki/OnDialogResponse
EDIT : Viper was faster
Reply
#4

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!
Reply
#5

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

Quote:
Originally Posted by TahaAsif12
Посмотреть сообщение
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!
pawn Код:
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.
Should be , you missed '!' not
pawn Код:
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!

Quote:
Originally Posted by gotwarzone
Посмотреть сообщение
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
You need to increase the Float:range value which will help you to spread the area size ! let's say change to 50.0
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 50.0, X, Y, Z))
Reply
#7

Quote:
Originally Posted by gotwarzone
Посмотреть сообщение
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
hahahaa, I could be much faster If that "Spam limit" wasn't exist, the dodge power !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)