07.05.2014, 11:00
Hey there, i made a feature for vip in my server in which they can tp their vehicle to their position after chosen from a dialog box, but it is not working it all says you have tped vehicle with id 0 to your position and not tping the car at all. Here is my code.
pawn Код:
else if(dialogid == 30)
{
if(response)
{
switch(listitem)
{
case 0:
{
new veh, string[128];
if(!PlayerInfo[playerid][pVeh]) return SendClientMessage(playerid, COLOR_GREY, "You dont have a car in this slot.");
veh = PlayerInfo[playerid][pVeh];
new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetVehiclePos(veh, pos[0], pos[1], pos[2]);
LinkVehicleToInterior(veh, GetPlayerInterior(playerid));
format(string, sizeof(string), "You have teleported your %d id vehicle to you.", veh);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
case 1:
{
new veh, string[128];
if(!PlayerInfo[playerid][pVVeh]) return SendClientMessage(playerid, COLOR_GREY, "You dont have a car in this slot.");
veh = PlayerInfo[playerid][pVVeh];
new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetVehiclePos(veh, pos[0], pos[1], pos[2]);
LinkVehicleToInterior(veh, GetPlayerInterior(playerid));
format(string, sizeof(string), "You have teleported your %d id vehicle to you.", veh);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
}
}
}