Destroy Vehicle ... [HELP ME]
#1

Hello !
I Created A /Car And Player When Use This Command A Menu (OnPlayerSelectedMenuRow) Show For Player.
So, I Wanna Do Something When First Vehicle Spawned Nothing Happen.But When Spawn The Secend Vehicle First
Vehicle Destroy
This Is The Pawn Code
Plz Help Me...
pawn Код:
new string[256]; format(string,sizeof(string),"%s Spawned.",car); SendClientMessage(playerid,COLOR_YELLOW,string);
        carid = CreateVehicle(id,X+3,Y+2,Z,Angle,-1,-1,50000);
//      PutPlayerInVehicle(playerid,carid,0);
        TogglePlayerControllable(playerid,true);
        VehicleInfo[carid][bought] =playerid;
        if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
        SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
Reply
#2

Show your full code.
Reply
#3

Ajab...
This Is The All Code
Others Is Nothing
Pleas Some One Help ...
Reply
#4

Some One Help
Reply
#5

Up...Help...
Reply
#6

Do:

pawn Код:
new carid[MAX_PLAYERS];
Then destroy it and create it like so:

pawn Код:
DestroyVehicle(carid[playerid]);
carid[playerid] = CreateVehicle(id,X+3,Y+2,Z,Angle,-1,-1,50000);
Reply
#7

Weponz Not Help...
pawn Код:
if(Current == Car) {
        new car[20],Float:X,Float:Y,Float:Z,Float:Angle,id,carid;
        GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,Angle);
        switch(row) {
          case 0: car = "Infernus", id = 411;
          case 1: car = "NRG-500", id = 522;
          case 2: car = "Turismo", id = 451;
          case 3: car = "Sultan", id = 560;
          case 4: car = "BF Injection", id = 424;
          case 5: car = "Banshe", id = 429;
          case 6: car = "Bullet", id = 541;
          case 7: car = "SandKing", id = 495;
          case 8: car = "JetMax", id = 493;
          case 9: car = "Maverick", id = 487;
          case 10: car = "Shamal", id = 519;
        }
        new string[256]; format(string,sizeof(string),"Shoma Mashin %s Entekhab Kardid.",car); SendClientMessage(playerid,COLOR_YELLOW,string);
        carid = CreateVehicle(id,X+3,Y+2,Z,Angle,-1,-1,50000);
//      PutPlayerInVehicle(playerid,carid,0);
        TogglePlayerControllable(playerid,true);
        printf("[CAR] Admin %s(%d) Mashin %s Ra Spawn Kard.",PlayerName(playerid),playerid,car);
        VehicleInfo[carid][bought] =playerid;
        if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
        SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
    }
This Is The All Code Please Some One Help
Reply
#8

it is done like this
pawn Код:
LastCar[MAX_PLAYERS];//on top



//this the edited command
DestroyVehicle(LastCar[playerid]);//added this
new string[256]; format(string,sizeof(string),"Shoma Mashin %s Entekhab Kardid.",car); SendClientMessage(playerid,COLOR_YELLOW,string);
        LastCar[playerid] = CreateVehicle(id,X+3,Y+2,Z,Angle,-1,-1,50000);//modified this
//      PutPlayerInVehicle(playerid,carid,0);
        TogglePlayerControllable(playerid,true);
Reply
#9

Sorry
I Get This Error Code
.pwn(9416) : warning 203: symbol is never used: "carid"
And This Is The Line 9416 :
pawn Код:
new car[20],Float:X,Float:Y,Float:Z,Float:Angle,id,carid;
Reply
#10

pawn Код:
static carid;
    carid= GetPlayerVehicleID(playerid);
Here you go
Reply
#11

MacT Where I Most Enter This Code ?
Reply
#12

Please Someone Help
Reply
#13

delete carid variable from declaration [means from that line]
there is no use of it now
Reply
#14

BroZeus Please Add Me In Skype To I Contact You...
Reply
#15

Sorry, I was wrong little, yes this means you have unsused variable carid, delete it and also you got working your code or not?
Reply
#16

Not Work
Please Some One Add Me In Skype To Help Me
Skype ID : mamad.venom
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)