[Pomoc] Mehanicar /towcar

Započeo []Flynâ„¢, Decembar 30, 2010, 22:36:35 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Imam komandu /towcar i sad kad zakaci auto odveze ga do CheckPointa i kad stigne auto koji je zakacen nece da se respawna!
Kako to da napravim?Evo komande:


if(strcmp(cmd,"/towcar",true)==0)
{
   if(IsPlayerConnected(playerid))
{
   if(PlayerInfo[playerid][samoPosao] == 7)
   {
       if(IsPlayerInAnyVehicle(playerid))
       {
    if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
      {
         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));
          SendClientMessage(playerid, COLOR_DBLUE, "Odvezi auto do CheckPointa");
          CP[giveplayerid] = 14000;
      SetPlayerCheckpoint(giveplayerid, 1071.9576,-1765.1212,14.6134,10.0);
}
}
    }
if(!Found)
{
  SendClientMessage(playerid,SVETLOPLAVA,"Nisi dovoljno blizu auta");
  }
}
else
{
SendClientMessage(playerid, SVETLOPLAVA, "Niste u vozilu");
return 1;
}
}
else
{
SendClientMessage(playerid, SVETLOPLAVA, "Niste u autu od Mehanicara");
return 1;
}
}
else
{
SendClientMessage(playerid, SVETLOPLAVA, "Niste u vozilu");
return 1;
}
}
else
{
SendClientMessage(playerid,SVETLOPLAVA,"Niste Mehanicar");
return 1;
}
}
return 1;
}
Poslednja Izmena: Decembar 30, 2010, 22:38:52 POSLE PODNE od Juxy