Code don't work, - Please help!
#3

pawn Код:
// samgreen: I believe it is dcmd practice to name this variable params
dcmd_tow(playerid, params[]) {
    // If you use zcmd you will not have to suppress this warning.
    #pragma unused params

    new VID = GetPlayerVehicleID(playerid);
    if(GetVehicleModel(VID) != 525) return  SendClientMessage(playerid, COLOR_RED,"You have to be in a tow truck");
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED,"You have to be the driver to tow a car.");
    new Float:vX,Float:vY,Float:vZ;
    for(new c = 0; c < MAX_VEHICLES; c++)
    {
        GetVehiclePos(c, vX, vY, vZ);
        if(IsPlayerInRangeOfPoint(playerid, 20.0, vX, vY, vZ) && c != VID)
        {
                AttachTrailerToVehicle(c, VID);
                SendClientMessage(playerid, COLOR_RED,"You have succesfully attached a vehicle!");
                break;
        }
    }
}
Now try this code and explain to us exactly how it is not working? Is it not attaching the vehicles? Are you getting any status messages?
Reply


Messages In This Thread
Code don't work, - Please help! - by Danny - 30.09.2010, 13:41
Re: Code don't work, - Please help! - by wups - 30.09.2010, 14:37
Re: Code don't work, - Please help! - by samgreen - 01.10.2010, 01:14

Forum Jump:


Users browsing this thread: 1 Guest(s)