16.10.2016, 02:10
PHP код:
CMD:towcar(playerid, params[])
{
if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
if(PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader] != 6) return SendClientMessage(playerid, COLOR_ERROR, "Nu faci parte din Tow Truck Company.");
{
new vid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) != 2 && !IsATCCCar(vid)) return SendClientMessage(playerid, COLOR_ERROR, "You are not driver of a Tow Truck.");
if(GetVehicleModel(vid) != 525) return SendClientMessage(playerid, COLOR_ERROR, "You are not driver of a Tow Truck.");
if(IsTowing[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You already towing a vehicle.");
if(PlayerInfo[playerid][pTowPoints] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You cannot tow any car till PayDay.");
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
new veh = GetPlayerVehicleID(playerid);
GetVehicleHealth( veh, health );
if(health > 900.0)
{
format(gString, sizeof(gString), "Acel vehicul prezinta mai putin de 10%s daune, nu il poti tracta!", "%%");
SendClientMessage(playerid, COLOR_ERROR, gString );
return 1;
}
PlayerInfo[playerid][pTowPoints] --;
Update(playerid, pTowPointsx);
CP[playerid] = 90;
UseFind[playerid] = 0;
IsTowing[playerid] = 1;
SetPlayerCheckpoint(playerid, 2409.8416,-1425.7860,23.9826, 5.0);
SendClientMessage(playerid, COLOR_SYN2, "Go to the checkpoint and destroy the car.");
CP_Timer[playerid] = gettime();
}
else SendClientMessage(playerid, COLOR_ERROR, "You dont have a vehicle attached.");
}
return 1;
}