how do i get this work?
#1

I've made this CMD so i can get in on a RC car but when i type /rc its not entering the RC Vehicle.

Here's the code

pawn Код:
CMD:rc(playerid, params[])
{
    new closestcar = GetClosestCar(playerid);
    if(IsARC(closestcar) && IsPlayerInRangeOfVehicle(playerid, closestcar, 5.0))
    {
        if(IsPlayerInVehicle(playerid, closestcar))
        {
            new Float:vehPos[3];
            GetVehiclePos(closestcar, vehPos[0], vehPos[1], vehPos[2]);
            SetPlayerPos(playerid, vehPos[0], vehPos[1]+0.5, vehPos[2]+0.5);
        }
        else if(!IsPlayerInAnyVehicle(playerid))
        {
            foreach(Player, i)
            {
                new v = GetPlayerVehicle(i, closestcar);
                if(v != -1 && PlayerVehicleInfo[i][v][pvLocked] == 0)
                {
                    new Float:playerPos[3];
                    GetPlayerPos(playerid, playerPos[0], playerPos[1], playerPos[2]);
                    SetPlayerPos(playerid, playerPos[0], playerPos[1], playerPos[2]-500);
                    PutPlayerInVehicle(playerid, closestcar, 0);
                }
            }
        }
    }
    return 1;
}
This is the stock
pawn Код:
IsARC(carid) // RC Vehicles
{
    new RCs[] = { 441, 464, 465, 501, 564 };
    for(new i = 0; i < sizeof(RCs); i++)
    {
        if(GetVehicleModel(carid) == RCs[i]) return 1;
    }
    return 0;
}
Reply
#2

whats the problem, any errors?
Reply
#3

No errors but when o type /rc its not entering on the RC vehicle
Reply
#4

Debug.
Reply
#5

Debug what?
Reply
#6

Is this correct?
Reply
#7

Quote:
Originally Posted by sampmark05
Посмотреть сообщение
Debug what?
A banana.

Use print(f) and SendClientMessage so you can see a visual representation of how your code is being executed.
Reply
#8

Ohh Thanks :P u get my1REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)