29.02.2012, 16:21
(
Последний раз редактировалось trulis; 29.02.2012 в 16:54.
)
like this?
pawn Код:
if(strcmp(cmdtext, "/towls", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
{
if(IsPlayerInVehicle(playerid, 230) || IsPlayerInVehicle(playerid, 233) || IsPlayerInVehicle(playerid, 234) || IsPlayerInVehicle(playerid, 235) || IsPlayerInVehicle(playerid, 325) || IsPlayerInVehicle(playerid, 314))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
if(PlayerInfo[playerid][pTow] >= 1)
{
PlayerInfo[playerid][pTow] -= 1;
CP[playerid] = 75;
SetPlayerCheckpoint(playerid, 2412.4646,-1426.3083,23.9848, 5.0);
SendClientMessage(playerid, COLOR_YELLOW, "Drive to Warehouse to destroy the towed car.");
}
new m = GetVehicleModel(GetPlayerVehicleID(playerid));
if (m == 525 || m == 552)
{
if(GetPlayerState(playerid)==2)
{
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
new Float:vX,Float:vY,Float:vZ;
new Found=0;
new vid=0;
while((vid<MAX_VEHICLES)&&(!Found))
{
vid++;
GetVehiclePos(vid,vX,vY,vZ);
if ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
{
Found=1;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
}
else
{
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
}
}
}
if(!Found)
{
SendClientMessage(playerid,0xFFFF00AA,"There is no car in range.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You need to be the driver!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You need to be in a Tow truck to use this!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You cannot tow any car till PayDay.");
}
}
}
}
}