CMD:towcar
#1

hei all, i make a command for members TCC to can park personal players vehicles but not work, what is't wrong ? i try everyting
PHP код:
CMD:towpark(playerid, params[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai.");
    if(
PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) return SCM(playerid,-1,"Nu esti mebru TCC.");
    
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    new 
Float:x,Float:y,Float:z,Float:a,getcarid;
    
getcarid = GetPlayerVehicleID(playerid);
    
GetVehiclePos(getcarid, x, y, z);
    
GetVehicleZAngle(getcarid, a);
    
            new 
Float:health2;
            
GetVehicleHealth(getcarid, health2);
            if(
health2 < 600.0) return SCM(playerid,COLOR_WHITE,"{ED2D20}Please repair your car.");
            if(
getcarid == personalcar[playerid])
            {
                
CarInfo[OwnedVeh(getcarid)][cLocationx] = x;
                
CarInfo[OwnedVeh(getcarid)][cLocationy] = y;
                
CarInfo[OwnedVeh(getcarid)][cLocationz] = z;
                
CarInfo[OwnedVeh(getcarid)][cAngle] = a;
                
DestroyVehicle(personalcar[playerid]);
                new 
created = OwnedVeh(getcarid);
                
OwnedVeh(getcarid) = 0;
                 new 
car = CreateVehicle(CarInfo[created][cModel],CarInfo[created][cLocationx],CarInfo[created][cLocationy],CarInfo[created][cLocationz]+1.0,CarInfo[created][cAngle],CarInfo[created][cColorOne],CarInfo[created][cColorTwo],500000);
                
OwnedVeh(car) = created;
                
personalcar[playerid] = car;
                
PutPlayerInVehicleEx(playerid,car,0);
                new 
carplate[25];
                
format(carplate, sizeof(carplate), "%s",CarInfo[OwnedVeh(car)][cLicense]);
                
SetVehicleNumberPlate(car, carplate);
                  
SetVehicleHealth(car, health2);
                  
vehEngine[car] = 0;
                
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
                  
SetVehicleParamsEx(car,VEHICLE_PARAMS_OFF,lights,alarm,CarInfo[PlayerInfo[playerid][pPcarkey]][cLock],bonnet,boot,objective);
                
SetPVarInt(playerid, "Engine", 0);
                
vUpdate(OwnedVeh(car),cLocationxx);
                
vUpdate(OwnedVeh(car),cLocationyx);
                
vUpdate(OwnedVeh(car),cLocationzx);
                
vUpdate(OwnedVeh(car),cAnglex);
                
ModVehicle(car);
                
SendClientMessage(playerid, COLOR_WHITE, "Car was parked successfully.");
                return 
1;
            }
        
    return 
1;
} 
Reply
#2

You are using a lot of functions there tell can't help without seeing those...
Reply
#3

anybody ? ~!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)