18.07.2014, 16:27
Hello I'm trying a command, so for start I tried to detect if player is near vehicle but it's not working
everytime I write /bomb it spam me msg "No vehicles near you to plant bomb" even if I'm close to vehicle
everytime I write /bomb it spam me msg "No vehicles near you to plant bomb" even if I'm close to vehicle
pawn Код:
if(strcmp(cmd, "/bomb", true) == 0)
{
new Float:X, Float:Y, Float:Z;
for(new a = 0; a < MAX_VEHICLES; a++)
{
GetVehiclePos(a, X, Y, Z);
if(IsPlayerInRangeOfPoint(a, 4.0, X, Y, Z))
{
SendClientMessage(playerid, -1, "{FF6A22}INFO:{FFFFFF} Bomb planted!");
}
else
{
SendClientMessage(playerid, -1, "{FF6A22}INFO:{FFFFFF} No vehicles near you to plant bomb.");
}
}
return 1;
}