undefined "ProxDetector"
#1

Hello.

I want to add this after some1 uses /vlock

Player_name unlocked the vehicle.

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

PHP код:
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;

Reply
#2

Did you copy this code from somewhere? Does the function ProxDetector exist in your script?
Reply
#3

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

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

Quote:
Originally Posted by ComDuck
Посмотреть сообщение
Does the function ProxDetector exist in your script?
- No

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
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
Посмотреть сообщение
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?
Reply
#6

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

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
Use IsPlayerInRangeOfPoint combined with GetPlayerPos then display the message with SendClientMessage to whoever is near the player.
can you show me how?
Reply
#8

Код:
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");
}
Reply
#9

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
Код:
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)