23.01.2013, 18:18
Hi all,
quero create a command to detect a vehicle position with GetVehicleModelInfo function and its parameters.
but I've done everything and it does not work: S: (.
Here I give a test of what I did:
Thanks in advance.
sorry for my English.
quero create a command to detect a vehicle position with GetVehicleModelInfo function and its parameters.
but I've done everything and it does not work: S: (.
Here I give a test of what I did:
pawn Код:
COMMAND:test(playerid, params[])
{
new newid=0, count=0, Float:pos[3];
for(new v = 0; v <= MAX_VEHICLES; v++)
{
newid= v;
GetVehicleModelInfo(GetVehicleModel(newid), VEHICLE_MODEL_INFO_PETROLCAP, pos[0], pos[1], pos[2]);
if(IsPlayerInRangeOfPoint(playerid, 5.0, pos[0],pos[1],pos[2]))
{
count++;
break;
}
}
switch(count)
{
case 0:
{
SendClientMessage(playerid, -1, "PETROLCAP No Detected");
}
case 1:
{
SendClientMessage(playerid, -1, "PETROLCAP Yes Detected");
}
default:
{
SendClientMessage(playerid, -1, "PETROLCAP Over 1 Detected");
}
}
return 1;
}
sorry for my English.