Jump to content
  • 0

Comanda


mimicami

Question

Salut! Am o mica problema:cand spawnez o masina, si dau respawn nu imi dispare si imi apare unde am spawnat-o. Daca ma poate ajuta cineva sa o fac sa dispara. Aceasta este comanda de respawn. Multumesc!

CMD:vrespawn(playerid, params[])

{

    new sec,string[128];

    if(sscanf(params,"i",sec)) return SendClientMessage(playerid, COLOR_RED, "USAGE:/vrespawn [seconds]");

    SetTimer("vrespawn", sec*1000, false);

    format(string, sizeof(string), "~All currently unoccupied vehicles will respawn in %d seconds.",sec);

    SendClientMessageToAll(COLOR_ORANGE, string);

    return 1;

}

forward vrespawn();

public vrespawn()

{

    new u[MAX_VEHICLES];

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

    {

        if(IsPlayerInAnyVehicle(i)) u[GetPlayerVehicleID(i)]=1;

    }

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

    {

        if(u != 1) SetVehicleToRespawn(i); else continue;

    }

    SendClientMessageToAll(COLOR_ORANGE, "~All vehicles have been respawned.");

    return 1;

}

Link to comment
Share on other sites

3 answers 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.