hy i have a problem ... -
Im_BanK - 13.03.2009
Hy im wondering if is possible to GetVehiclePosition of the CarSpawns...
i want to make a command to get the current vehicle position from CarSpawns ..
i want to make the /tow command to get the current position from carspawns and to give me a message like "that car is not in need of a Tow bec is already on the Spawn Position"
pawn Код:
new CarSpawns[3][eCars] = {
{545,2205.2,-1177.0,25.7,270.8},//carid 90
{554,2205.1,-1169.1,25.7,270.8},
{426,2216.7,-1170.6,25.7,268.3}
};
enum eCars
{
model_id,
Float:pos_x,
Float:pos_y,
Float:pos_z,
Float:z_angle,
};
how can i make that command to get the position above ?
sorry for my bad english im a romanian
thx
Re: hy i have a problem ... -
Im_BanK - 13.03.2009
common ....
nobody knows?
Re: hy i have a problem ... -
Kanji_Suzuki - 13.03.2009
Код:
how can i make that command to get the position above ?
you mean a teleport?
Re: hy i have a problem ... -
Im_BanK - 13.03.2009
no...
i want to get the vehicle position (carspawns position)
when i will try to /tow a car and that car is in the actual Point (vehicle original Location (spawn point)) to send me a message "bla bla bla"
Re: hy i have a problem ... -
Im_BanK - 14.03.2009
nobody?
common, i really need this ...
i can't make that getvehicleposition to get the carspawns coords...
Re: hy i have a problem ... -
Kanji_Suzuki - 14.03.2009
i dont see what you mean tell me more
Re: hy i have a problem ... -
lesley - 14.03.2009
pawn Код:
stock GetVehiclePos2(id, &Float:x, &Float:y, &Float:z)
{
x = CarSpawns[id][pos_x];
y = CarSpawns[id][pos_y];
z = CarSpawns[id][pos_z];
}
Re: hy i have a problem ... -
Im_BanK - 14.03.2009
i have this Code
pawn Код:
if(strcmp(cmd,"/tow",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] == 7)
{
if(IsPlayerInAnyVehicle(playerid))
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
{
if(GetPlayerState(playerid)==2)
{
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
new Float:vX,Float:vY,Float:vZ;
new Found=0;
new vid=0;
while((vid<MAX_VEHICLES)&&(!Found))
{
vid++;
GetVehiclePos(vid,vX,vY,vZ);
if ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
{
Found=1;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
}
else
{
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_GRAD2, "Tow the car to the Checkpoint shown on the minimap.");
CP[playerid] = 22;
SetPlayerCheckpoint(playerid,2185.7034,-1992.6033,13.4245,6.0);
}
}
}
if(!Found)
{
SendClientMessage(playerid,0xFFFF00AA,"There is no car in range.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You need to be the driver!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You need to be in a Tow truck to use this!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You need to be in a vehicle to do this!");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD2,"You need to be a Mechanic to use this!");
return 1;
}
}
return 1;
}
can you show me what can i do to get the CarSpawns Position?
thx for helping me
Much Respect