04.04.2011, 00:46
Hello,
I am trying to create a /towcar command:
When I compile I get no errors or warnings, but when I go in game and I do /towcar next to a vehicle and I am in a tow truck it does not tow the vehicle. Help me out and thanks.
I am trying to create a /towcar command:
pawn Код:
if(strcmp(cmd,"/towcar",true)==0)
{
if(PlayerInfo[playerid][pJob] == 7 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
}
else
{
AttachTrailerToVehicle(VIDS,GetPlayerVehicleID(playerid));
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not in a tow truck");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not authorized to use this command");
}
return 1;
}