[Ayuda] /lock ( Vehiculo )
#1

Necesito limitar el comando de mi vehiuclo cuando este cerca de йl.

Muchas Gracias!


Код:
if(strcmp(cmd, "/lock", true) == 0 || strcmp(cmd, "/lock", true) == 0) // By Ellis
 {
                new keycar = PlayerInfo[playerid][pPcarkey];
                if(keycar != 999)
                {
                    new locked[256];
                    locked = strtok(cmdtext, idx);
     if(CarInfo[keycar][cLock] == 1)
                    {
                     for(new i = 0; i < MAX_PLAYERS; i++)
      {
       if (IsPlayerConnected(i))
       {
        SetVehicleParamsForPlayer(keycar,i,0,0);
       }
      }
      format(string, sizeof(string), "~w~Coche~n~~g~Desbloqueado");
      GameTextForPlayer(playerid, string, 4000, 3);
      CarInfo[keycar][cLock] = 0;
      OnPropUpdate();
      return 1;
     }
     else if(CarInfo[keycar][cLock] == 0)
     {
         for(new i = 0; i < MAX_PLAYERS; i++)
      {
       if (IsPlayerConnected(i))
       {
        SetVehicleParamsForPlayer(keycar,i,0,1);
       }
      }
      format(string, sizeof(string), "~w~Coche~n~~r~Bloqueado");
      GameTextForPlayer(playerid, string, 4000, 3);
      CarInfo[keycar][cLock] = 1;
      OnPropUpdate();
      return 1;
     }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, " No tienes un vehнculo!");
                    return 1;
                }
         }
Reply
#2

Podrias usar algo asi xD
pawn Код:
for(new i; i != MAX_VEHICLES; i++)
                {
                    new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
                    if(dist)
                    {
Lo demas y el mensaje seguilo xD
Reply
#3

Perdona me puedes explicar como poner ese script, porfavor?
Reply
#4

Que podes modificarlo segun la distancia del auto, ej:
pawn Код:
new counter = 0;
                new result;

                for(new i; i != MAX_VEHICLES; i++)
                {
                    new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
                    if(dist)
                    {
                        result = i;
                        counter++;
                    }
                }
                switch(counter)
                {
                    case 0:
                    {
                        SendClientMessage(playerid, COLOR_GREY, "No estas cerca del coche");
                    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)