transform car
#5

Not a bad attempt; just a few errors to correct:
pawn Код:
if(strcmp(cmd, "/rp", true) == 0)
{
    //if(IsPlayerConnected(playerid)) < ----    this check isn't needed: we know the player is connected
    //                                          because he has just typed the command
    //{
        new Float:x, Float:y, Float:z, Float:Angle;
        GetPlayerPos(playerid,x,y,z); // ideally you would use GetVehiclePos when a player is in a vehicle, but it's ok
        GetPlayerFacingAngle(playerid,Angle); // same for this, GetVehicleZPos to find a vehicle rotation angle
        if (PlayerInfo[playerid][pAdmin] >= 5)
        {
            //new car;
            //car = strval(tmp); <--- I'm not sure where tmp comes from
            //if(car == infernus)
            //{
                new currentveh;
                currentveh = GetPlayerVehicleID(playerid);
                DestroyVehicle(currentveh);
                currentveh = CreateVehicle(411,x,y,z,Angle,0,0,3000); // create the new vehicle into the currentveh variable
                PutPlayerInVehicle(playerid,currentveh,0); // put player into the new currentveh
                SetVehicleZAngle(currentveh, Angle); // set the vehicle rotation
            //}
        }
    //}
}
I've left comments on the stuff I have changed. Typing /rp as an admin level 5+ should now transform your vehicle into a black infernus!
Reply


Messages In This Thread
transform car - by farris - 17.12.2010, 23:31
Re: transform car - by blackwave - 17.12.2010, 23:35
Re: transform car - by Benjo - 17.12.2010, 23:59
Re: transform car - by farris - 18.12.2010, 00:40
Re: transform car - by Benjo - 18.12.2010, 00:55
Re: transform car - by farris - 18.12.2010, 01:01
Re: transform car - by farris - 18.12.2010, 03:07

Forum Jump:


Users browsing this thread: 2 Guest(s)