Jump to content
  • 0

Problema /RespawnAllCars


wifi123

Question

Am si eu o problema cu , comanda /respawnallcars , daca pun o masina langa icon-ul de la o casa si dau /respawnallcars , se incurca textdraw-urile , adica masina ia textdraw-ul cu owner , pret...etc de la casa

[pawn]dcmd_rac(playerid, params[]){

#pragma unused params

    if(PlayerInfo[playerid][Level] <= 12){

        SendClientMessage(playerid, red, "ERROR:You can't use this command!");

    }

    else

    {

        new str[128];

        GetPlayerName(playerid, str, sizeof(str));

        format(str, sizeof(str), "{FFFFFF}Owner {0049FF}%s {FFFFFF}has respawned all the unused cars", str);

        for(new i = 0; i < MAX_VEHICLES; i++)

        {

            if(IsVehicleOccupied(i) == 0)

            {

                SetVehicleToRespawn(i);

                PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);

                SendClientMessage(i, red, str);

            }

        }

    }

    return 1;

}[/pawn]

[pawn]stock IsVehicleOccupied(vehicleid)

{

  for(new i = 0; i < MAX_PLAYERS; i++)

    if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)

      return 1;

  return 0;

}[/pawn]

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.