error 017: undefined symbol "ProxDetector"
CMD:vlock(playerid, params[])
{
new vehicleid;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
vehicleid = GetPlayerVehicleID(playerid);
}
else
{
vehicleid = GetClosestVehicle(playerid);
if(!PlayerToVehicle(playerid, vehicleid, 5.0)) vehicleid = 0;
}
if(!vehicleid) return SendClientMessage(playerid, COLOR_RED, "You are not close to a vehicle!");
new id = GetVehicleID(vehicleid);
if(!IsValidVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
if(GetPlayerVehicleAccess(playerid, id) < 2)
return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(doors == 1)
{
new sendername[MAX_PLAYER_NAME];
new string[128];
doors = 0;
VehicleLock[id] = 0;
PlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s vadi pari i ja plakja patarinata.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(playerid, "~g~doors unlocked", 3000, 6);
}
else
{
doors = 1;
VehicleLock[id] = 1;
GameTextForPlayer(playerid, "~r~doors locked", 3000, 6);
}
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SaveVehicle(id);
return 1;
}
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 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)
|
Use IsPlayerInRangeOfPoint combined with GetPlayerPos then display the message with SendClientMessage to whoever is near the player.
|
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"); }
Код:
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"); } |