SA-MP Forums Archive
Ajuda para destruir carros - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: Ajuda para destruir carros (/showthread.php?tid=232416)



Ajuda para destruir carros - [AF]Junior - 27.02.2011

Bom, quando digito /elegy preciso ser vip e tals, ele spawna tudo bem.

Mas quero digitar outro carro por exemplo /jester, quero que o elegy se destrua!

Como faзo isso?

pawn Код:
CMD:elegy(playerid, params[])
{
    if(PlayerInfo[playerid][VIP] != 1) return SendClientMessage(playerid,0xD8D8D8FF,"Vocк nгo й VIP!");
    new Float:X,Float:Y,Float:Z,Float:Angle, carid;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid,Angle);
    carid = GetPlayerVehicleID(playerid);
    carid = CreateVehicle(562,X,Y,Z,0.0,-1,-1,9000000);
    new Text3D:vehicle3Dtext;
    vehicle3Dtext = Create3DTextLabel( "Veнculo VIP", 0xB4B5B7FF, 30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToVehicle(vehicle3Dtext, carid, 0.0,-0.0,0.5);
    PutPlayerInVehicle( playerid, carid, 0)   ;
    LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
    AddVehicleComponent( carid, 1028)   ;
    AddVehicleComponent( carid, 1046)   ;
    AddVehicleComponent( carid, 1171)   ;
    AddVehicleComponent( carid, 1149)   ;
    AddVehicleComponent( carid, 1035)   ;
    AddVehicleComponent( carid, 1147)   ;
    AddVehicleComponent( carid, 1036)   ;
    AddVehicleComponent( carid, 1040)   ;
    ChangeVehiclePaintjob( carid, 2)   ;
    AddVehicleComponent( carid, 1010)   ;
    AddVehicleComponent( carid, 1097)   ;
    AddVehicleComponent( carid, 1087)   ;
    TogglePlayerControllable(playerid,true);
    return 1;
}
valeu...


Re: Ajuda para destruir carros - CyNiC - 27.02.2011

Colocar no topo:
pawn Код:
new iddoultimoveiculocriado[MAX_PLAYERS];
Colocar nos comandos:
pawn Код:
DestroyVehicle(iddoultimoveiculocriado[playerid]);
iddoultimoveiculocriado[playerid] = CreateVehice(...);
Colocar no OnPlayerConnect:
pawn Код:
iddoultimoveiculocriado[playerid] = -1;



Re: Ajuda para destruir carros - bruno-style - 27.02.2011

Quote:
Originally Posted by CyNiC
Посмотреть сообщение
CreateVehice(...);[/pawn]
Vehice ?, Й Vehicle.

Eu tentei aqui este codigo e funcionou correto, coloque Junior e irб funcionar :d