Teleport to owner car problem
#1

I got a problem about the teleport to owner car, example going to teleport to our car but it goes to someone else car.

Is there any bug?

Код:
CMD:mycars(playerid, params[])
{
	new vstring[1024];
	for(new i, iModelID; i < MAX_PLAYERVEHICLES; i++) {
		if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0) {
			if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
				format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[iModelID]);
			}
			else format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[iModelID]);
		}
		else strcat(vstring, "\nEmpty Slot");
	}
	ShowPlayerDialog(playerid, MYCAR, DIALOG_STYLE_LIST, "Player Vehicle", vstring, "Teleport", "Cancel");
	return 1;
}
and heres the dialog look's ok to me i think

Код:
	if(dialogid == MYCAR)
	{
	    if(response == 1)
	    {
	        for(new i = 0; i < MAX_PLAYERVEHICLES; i++)
	        {
	            if(listitem == i)
	            {
                    new Float: carPos[3], id = GetPVarInt(playerid, "playeraffectedcarTP");
					if(PlayerVehicleInfo[playerid][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
					{
						GetVehiclePos(PlayerVehicleInfo[playerid][i][pvId], carPos[0], carPos[1], carPos[2]);
						SetPlayerVirtualWorld(playerid,GetVehicleVirtualWorld(PlayerVehicleInfo[playerid][i][pvId]));
						SetPlayerInterior(playerid,0);
						SetPlayerPos(playerid, carPos[0], carPos[1], carPos[2]);
					}
					else
					{
					    SendClientMessageEx(playerid, COLOR_WHITE, "You can not teleport to a empty/impounded slot.");
					}
				}
			}
	    }
	}
Reply
#2

Change these lines:

pawn Код:
new iModelID;
for(new i; i < MAX_PLAYERVEHICLES; i++) {
        if((iModelID = PlayerVehicleInfo[i][pvModelId] - 400) >= 0) {
            if(PlayerVehicleInfo[i][pvImpounded]) {
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)