IsPlayerInRangeOfPoint
#1

I have made this script here and I have a problem with it. It works great but it doesn't show me "Go to Ammunation entrace if you wish to buy guns." when i'm far away, this only shows after i type /wlist once i'm already near Ammunation.. I've been trying to figure it out for some hour now.

What's missing?

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/wlist"))
    {
         if(
IsPlayerInRangeOfPoint(playerid7.01367.9517,-1279.9250,13.5469))
        {
            
SendClientMessage(playerid,0xFFFFFFFF,"Go to Ammunation entrace if you wish to buy guns.");
            
ShowPlayerDialog(playerid67DIALOG_STYLE_LIST"Weapon shop""Armour - 7000$\nChainsaw - 50000$\nGrenade - 7500$\nMolotov Cocktail - 5500$\nDesert Eagle - 8500$\nSawnoff Shotgun - 10000$\nCombat Shotgun - 8000$\nUzi - 5000$\nTec-9 - 5000$\nMP5 - 7000$\nM4A1 - 15000$\nAK47 - 13000$\nSniper Rifle - 20000$\nRPG - 350000$\nFlamethower - 250000$\nSatchel Charge - 150000$\nFire Extinguisher - 10000$\nThermal Goggles - 5000$\nParachute - 1000$\nHealth - 5000$""Buy""Cancel");
        }
        return 
1;
    }
      return 
0;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 67)
    {
        if(!
response)
        return 
1;
        switch(
listitem)
    { 
Reply
#2

I couldn't really understand what you ment but i'd assume it was this

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/wlist"))
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 1367.9517,-1279.9250,13.5469)) //This checks if they're inside the point
        {
            //You had the message here assuming the player WAS infact inside the point
            ShowPlayerDialog(playerid, 67, DIALOG_STYLE_LIST, "Weapon shop", "Armour - 7000$\nChainsaw - 50000$\nGrenade - 7500$\nMolotov Cocktail - 5500$\nDesert Eagle - 8500$\nSawnoff Shotgun - 10000$\nCombat Shotgun - 8000$\nUzi - 5000$\nTec-9 - 5000$\nMP5 - 7000$\nM4A1 - 15000$\nAK47 - 13000$\nSniper Rifle - 20000$\nRPG - 350000$\nFlamethower - 250000$\nSatchel Charge - 150000$\nFire Extinguisher - 10000$\nThermal Goggles - 5000$\nParachute - 1000$\nHealth - 5000$", "Buy", "Cancel");
        }
        else SendClientMessage(playerid,0xFFFFFFFF,"Go to Ammunation entrace if you wish to buy guns."); //This will show the message if the player isn't inside the point
        return 1;
    }
      return 0;
}
Reply
#3

Thank you so much, and thank you for the // part, helps out alot for a beginner who want's to learn(me) !
Reply
#4

This topic name might be wrong regarding this subject which i could need some help with, but anyhow.

Inside this script part, i'm trying to add that when player /detonate they will get 6 stars wanted level but no matter how I try it, when i compile it says "undefined symbol: SetWantedLevel". I'm not sure how to define that, a simple #define SetWantedLevel isn't working. Do i need to include another Inc? Or.. What's up here?

PHP код:
CMD:detonate(playeridparams[])
{
        new 
Float:X,Float:Y,Float:Z;
        if(
DetonateBomb[playerid] == 1)
        {
        new 
SVID SecurityVanID[playerid];
        
GetVehiclePos(SVIDX,Y,Z);
        
CreateExplosion(XYZ710);
        
SetVehicleHealth(SVID350);
        
SVBeingRobbed[SVID] = 1;
        
DetonateBomb[playerid] = 0;
        
MoneyLeft[SVID] = 5;
        
SendClientMessage(playerid, -1,"The bomb went off,  /fill  the bags and get out of here.");
        }
        else return 
SendClientMessage(playerid, -1,"You don't have a bomb planted anywhere.");
        return 
1;

If you need more then just this part, let me know I will post it asap.
Reply
#5

Quote:
Originally Posted by Sergeant
Посмотреть сообщение
This topic name might be wrong regarding this subject which i could need some help with, but anyhow.

Inside this script part, i'm trying to add that when player /detonate they will get 6 stars wanted level but no matter how I try it, when i compile it says "undefined symbol: SetWantedLevel". I'm not sure how to define that, a simple #define SetWantedLevel isn't working. Do i need to include another Inc? Or.. What's up here?

PHP код:
CMD:detonate(playeridparams[])
{
        new 
Float:X,Float:Y,Float:Z;
        if(
DetonateBomb[playerid] == 1)
        {
        new 
SVID SecurityVanID[playerid];
        
GetVehiclePos(SVIDX,Y,Z);
        
CreateExplosion(XYZ710);
        
SetVehicleHealth(SVID350);
        
SVBeingRobbed[SVID] = 1;
        
DetonateBomb[playerid] = 0;
        
MoneyLeft[SVID] = 5;
        
SendClientMessage(playerid, -1,"The bomb went off,  /fill  the bags and get out of here.");
        }
        else return 
SendClientMessage(playerid, -1,"You don't have a bomb planted anywhere.");
        return 
1;

If you need more then just this part, let me know I will post it asap.
I don't see any wanted level things in that code, but this is the function you should use:
pawn Код:
SetPlayerWantedLevel(playerid, level);
Reply
#6

Thank you !
Reply
#7

Quote:
Originally Posted by Sergeant
Посмотреть сообщение
Thank you !
You've never defined a variable for level therefor you've never given the player a wanted "level" If you want to give them a wanted level just use

pawn Код:
SetPlayerWantedLevel(playerid, 1); //This will give them 1 star

If you want to set their level via a variable just make something like

pawn Код:
new level[MAX_PLAYERS];

//Inside your command
level[playerid] = 1; //Setting that specific players level to 1
SetPlayerWantedLevel(playerid, level[playerid]); //This will add the star
Reply
#8

Quote:
Originally Posted by (*|Flake|*)
Посмотреть сообщение
You've never defined a variable for level therefor you've never given the player a wanted "level" If you want to give them a wanted level just use

pawn Код:
SetPlayerWantedLevel(playerid, 1); //This will give them 1 star

If you want to set their level via a variable just make something like

pawn Код:
new level[MAX_PLAYERS];

//Inside your command
level[playerid] = 1; //Setting that specific players level to 1
SetPlayerWantedLevel(playerid, level[playerid]); //This will add the star
He can just use this function to get their wanted level if he needs that, unless he wants to have a server-based wanted level as well that is.
pawn Код:
native GetPlayerWantedLevel(playerid);
Reply
#9

Quote:
Originally Posted by Sergeant
Посмотреть сообщение
This topic name might be wrong regarding this subject which i could need some help with, but anyhow.

Inside this script part, i'm trying to add that when player /detonate they will get 6 stars wanted level but no matter how I try it, when i compile it says "undefined symbol: SetWantedLevel". I'm not sure how to define that, a simple #define SetWantedLevel isn't working. Do i need to include another Inc? Or.. What's up here?

PHP код:
CMD:detonate(playeridparams[])
{
        new 
Float:X,Float:Y,Float:Z;
        if(
DetonateBomb[playerid] == 1)
        {
        new 
SVID SecurityVanID[playerid];
        
GetVehiclePos(SVIDX,Y,Z);
        
CreateExplosion(XYZ710);
        
SetVehicleHealth(SVID350);
        
SVBeingRobbed[SVID] = 1;
        
DetonateBomb[playerid] = 0;
        
MoneyLeft[SVID] = 5;
        
SendClientMessage(playerid, -1,"The bomb went off,  /fill  the bags and get out of here.");
        }
        else return 
SendClientMessage(playerid, -1,"You don't have a bomb planted anywhere.");
        return 
1;

If you need more then just this part, let me know I will post it asap.
PHP код:
CMD:detonate(playeridparams[])
{
    new 
Float:Pos[3];
    if(!
DetonateBomb[playerid] == 1) return SendClientMessage(playerid, -1"[SRV] You don't have a bomb placed.");
    
    new 
SVID SecurityVanID[playerid];
    
GetVehiclePos(SVIDPos[0], Pos[1], Pos[2]);
    
    
CreateExplosion(Pos[0], Pos[1], Pos[2], 710);
    
SetVehicleHealth(SVID350.0);
    
SetPlayerWantedLevel(playerid6);
    
    
SVBeingRobbed[SVID] = 1;
    
DetonateBomb[playerid] = 0;
    
MoneyLeft[SVID] = 5;
    
    
SendClientMessage(playerid, -1"[SRV] The bomb went off! "{1A80E6}"/fill "{FFFFFF}"the bags and get out of there!");

Reply
#10

This thread can be closed, i guess.
Thnx guys. Rep+ for all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)