Jump to content
  • 0

Problema /rac


w3b

Question

Nick: w3b

Problema: Problema cu comanda /rac , nu se respawneaza dupa 10 sec , asa cum ar trb .Eu cred ca am editat corect comanda nu are dc sa nu mearga , cum dai /rac se respawneaza pe loc. Ce sa fac ?

Erori / warnings: --

Lini/script: --

Ai incercat sa rezolvi singur ?: da.

[pawn]if(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerData[playerid][pAdmin] < 3)

{

    SendError(playerid,cmd);

    return 1;

}

new bool:unwanted[MAX_VEHICLES];

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

    {

        if(IsPlayerConnected(player))

{

            if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }

}

    }

    GetPlayerName(playerid, sendername, sizeof(sendername));

    format(string, sizeof(string), "{FFFFFF}Toate masinile nefolositoare vor fi respawneate in 10 secunde de catre admin {DB8E12}%s.", PlayerData[playerid][pNume]);

ABroadCast(COLOR_LIGHTRED,string,1);

for(new car = 1; car < MAX_VEHICLES; car++)

{

    if(car != INVALID_VEHICLE_ID)

    {

if(!unwanted[car])

{

SetTimer("ractime", 10000, 0);

SetVehicleToRespawn(car);

 

}

}

}

}

return 1;

}  [/pawn]

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Din ce vad eu aici

[pawn]if(!unwanted[car])

{

SetTimer("ractime", 10000, 0);

SetVehicleToRespawn(car);

 

}[/pawn]

Tu activezi timertul si spawnezi imediat masinile la accesarea comenzii.

Daca vrei la 10 secunde sterge acel SetvehicleToRespawn si muta-l in ractime.

Link to comment
Share on other sites

Am sters SetVehicleToRespawn(car); si acum nu se mai respawneaza de loc :) am stat 10 min si tot nu s-au respawnat

Asa am facut :

[pawn] if(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerData[playerid][pAdmin] < 3)

{

    SendError(playerid,cmd);

    return 1;

}

new bool:unwanted[MAX_VEHICLES];

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

    {

        if(IsPlayerConnected(player))

{

            if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }

}

    }

    GetPlayerName(playerid, sendername, sizeof(sendername));

    format(string, sizeof(string), "{FFFFFF}Toate masinile nefolositoare vor fi respawneate in 10 secunde de catre admin {DB8E12}%s.", PlayerData[playerid][pNume]);

ABroadCast(COLOR_LIGHTRED,string,1);

for(new car = 1; car < MAX_VEHICLES; car++)

{

    if(car != INVALID_VEHICLE_ID)

    {

if(!unwanted[car])

{

SetTimer("ractime", 10000, 0);

}

}

}

}

return 1;

}[/pawn]

Link to comment
Share on other sites

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.