SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/02/2019, 12:49 PM   #1
Dimkata
Big Clucker
 
Dimkata's Avatar
 
Join Date: Aug 2013
Posts: 58
Reputation: 0
Default undefined "ProxDetector"

Hello.

I want to add this after some1 uses /vlock

Player_name unlocked the vehicle.

But I get the following error:
PHP Code:
error 017undefined symbol "ProxDetector" 
Here is the cmd

PHP Code:
CMD:vlock(playeridparams[])
{
    new 
vehicleid;
    if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        
vehicleid GetPlayerVehicleID(playerid);
    }
    else
    {
        
vehicleid GetClosestVehicle(playerid);
        if(!
PlayerToVehicle(playeridvehicleid5.0)) vehicleid 0;
    }
    if(!
vehicleid) return SendClientMessage(playeridCOLOR_RED"You are not close to a vehicle!");
    new 
id GetVehicleID(vehicleid);
    if(!
IsValidVehicle(id)) return SendClientMessage(playeridCOLOR_RED"You don't have the keys for this vehicle!");
    if(
GetPlayerVehicleAccess(playeridid) < 2)
        return 
SendClientMessage(playeridCOLOR_RED"You don't have the keys for this vehicle!");
    new 
enginelightsalarmdoorsbonnetbootobjective;
    
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
    if(
doors == 1)
    {
        new 
sendername[MAX_PLAYER_NAME];
        new 
string[128];
        
doors 0;
        
VehicleLock[id] = 0;
          
PlayerName(playeridsendernamesizeof(sendername));
          
format(stringsizeof(string), "%s vadi pari i ja plakja patarinata."sendername);
          
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
GameTextForPlayer(playerid"~g~doors unlocked"30006);
    }
    else
    {
        
doors 1;
        
VehicleLock[id] = 1;
        
GameTextForPlayer(playerid"~r~doors locked"30006);
    }
    
SetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
    
SaveVehicle(id);
    return 
1;

Dimkata is offline   Reply With Quote
Old 20/02/2019, 04:03 PM   #2
ComDuck
Big Clucker
 
ComDuck's Avatar
 
Join Date: Feb 2019
Posts: 82
Reputation: 12
Default Re: undefined "ProxDetector"

Did you copy this code from somewhere? Does the function ProxDetector exist in your script?
ComDuck is offline   Reply With Quote
Old 20/02/2019, 04:17 PM   #3
TheToretto
Gangsta
 
TheToretto's Avatar
 
Join Date: Jul 2015
Posts: 600
Reputation: 66
Default Re: undefined "ProxDetector"

ProxDetector is a shitty include used to change color of the text depending on the distance between player and receiver, you can delete it as it is optional.
__________________






Toretto#9902

Rest in peace grandpa, 03 November 2018
TheToretto is offline   Reply With Quote
Old 20/02/2019, 04:44 PM   #4
TokicMajstor
Big Clucker
 
TokicMajstor's Avatar
 
Join Date: Oct 2018
Location: Bosnia And Herzegovina
Posts: 177
Reputation: 1
Default Re: undefined "ProxDetector"

I use Prox Detector for checking which players are near one player ( like for when I type in chat only near players can see it, as well as I know)
__________________


If Iam better than you = you're noob
If you're better than me = you're cheater
If everyone is better than me = I have lags
#Logic
TokicMajstor is offline   Reply With Quote
Old 20/02/2019, 07:39 PM   #5
Dimkata
Big Clucker
 
Dimkata's Avatar
 
Join Date: Aug 2013
Posts: 58
Reputation: 0
Default Re: undefined "ProxDetector"

Quote:
Originally Posted by ComDuck View Post
Does the function ProxDetector exist in your script?
- No

Quote:
Originally Posted by TheToretto View Post
ProxDetector is a shitty include used to change color of the text depending on the distance between player and receiver, you can delete it as it is optional.
- I deleted, but I dont get the message when i write vlock..

Quote:
Originally Posted by TokicMajstor View Post
I use Prox Detector for checking which players are near one player ( like for when I type in chat only near players can see it, as well as I know)
- Do you recommend anything else?
Dimkata is offline   Reply With Quote
Old 20/02/2019, 08:06 PM   #6
TheToretto
Gangsta
 
TheToretto's Avatar
 
Join Date: Jul 2015
Posts: 600
Reputation: 66
Default Re: undefined "ProxDetector"

Use IsPlayerInRangeOfPoint combined with GetPlayerPos then display the message with SendClientMessage to whoever is near the player.
__________________






Toretto#9902

Rest in peace grandpa, 03 November 2018
TheToretto is offline   Reply With Quote
Old 20/02/2019, 08:39 PM   #7
Dimkata
Big Clucker
 
Dimkata's Avatar
 
Join Date: Aug 2013
Posts: 58
Reputation: 0
Default Re: undefined "ProxDetector"

Quote:
Originally Posted by TheToretto View Post
Use IsPlayerInRangeOfPoint combined with GetPlayerPos then display the message with SendClientMessage to whoever is near the player.
can you show me how?
Dimkata is offline   Reply With Quote
Old 20/02/2019, 08:54 PM   #8
TheToretto
Gangsta
 
TheToretto's Avatar
 
Join Date: Jul 2015
Posts: 600
Reputation: 66
Default Re: undefined "ProxDetector"

Code:
new Float:Pos[3]; 
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);

for(new i; i < MAX_PLAYERS; i++)
{
    if(IsPlayerInRangeOfPoint(i, 7.0, Pos[0],Pos[1],Pos[2]))
        SendClientMessage(i, -1, "hello nearbie players");
}
__________________






Toretto#9902

Rest in peace grandpa, 03 November 2018
TheToretto is offline   Reply With Quote
Old 20/02/2019, 09:03 PM   #9
Kasichok
Big Clucker
 
Kasichok's Avatar
 
Join Date: Sep 2018
Location: weed farm
Posts: 56
Reputation: 24
Default Re: undefined "ProxDetector"

Quote:
Originally Posted by TheToretto View Post
Code:
new Float:Pos[3]; 
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);

for(new i; i < MAX_PLAYERS; i++)
{
    if(IsPlayerInRangeOfPoint(i, 7.0, Pos[0],Pos[1],Pos[2]))
        SendClientMessage(i, -1, "hello nearbie players");
}
I would also suggest to check if the player is in the same world
__________________



STRESSED? TRY KASICHOK AND RELAX


Kasichok is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem: undefined symbol "handle_mysql", "strcpy" CoachCarter Scripting Help 5 31/08/2016 12:27 PM
"error 017: undefined symbol "vehicleid"" problem. OMonger Scripting Help 5 31/01/2015 12:55 PM
Help error 017: undefined symbol "ProxDetector" z0nzjn123 Scripting Help 2 04/08/2013 11:35 AM
5 Dialog errors - Input line too long, undefined symbol "t","is" and "only" Deal-or-die Scripting Help 6 01/05/2012 12:08 PM


All times are GMT. The time now is 02:48 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.