14.03.2010, 21:33
pawn Код:
if (strcmp("/rebocar", cmdtext, true, 9) == 0)
{
if ((IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid)==PLAYER_STATE_DRIVER))
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
{
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;
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
SendClientMessage(playerid,COLOR_BLUE,"[Veiculo:] Carro Rebocado");
Tow[playerid] = 1;
}
}
if (!Found)
{
SendClientMessage(playerid,COLOR_RED,"[Serveridor:] Nгo ha carros perto de ti!");
}
}
}
return 1;
}