Szerző Téma: Carrespawn parancsra.  (Megtekintve 1042 alkalommal)

Carrespawn parancsra.
« Dátum: 2010. július 16. - 20:14:38 »
0 Show voters
Olyan modra lenne szükségem ami a /carresi vagy /carrespawn parancsra újrahelyezi a mapon az összes használaton kívüli autót.
Elore is köszönöm.

Nem elérhető Csabesz

  • 7827
    • Profil megtekintése
Carrespawn parancsra.
« Válasz #1 Dátum: 2010. július 16. - 20:33:06 »
0 Show voters
Tessék,
 
if ( strcmp ( cmdtext, \"/carrespawn\", true ) == 0 )
{
    for ( new vid = 0; vid < MAX_VEHICLES; vid ++ )
    {
        if ( !IsVehicleOccupied ( vid )
        {
            SetVehicleToRespawn ( vid );
        }
    }
    SendClientMessageToAll( 0xAA3333AA,\"* Minden használaton kívüli jármu helyreállítva!\" ); // Mindenkinek küld egy üzenetet
    return 1; // Visszatérés
}
stock IsVehicleOccupied ( vehicleid )
{
for ( new i = 0; i < MAX_PLAYERS; i++ )
{
if ( IsPlayerInVehicle ( i, vehicleid ) ) return 1;
}
return 0;
}

Nem elérhető BeNiBoY

  • 1342
    • Profil megtekintése
Carrespawn parancsra.
« Válasz #2 Dátum: 2010. július 17. - 07:11:13 »
0 Show voters

Carrespawn parancsra.
« Válasz #3 Dátum: 2010. július 18. - 11:43:02 »
0 Show voters
És tessék még egy... Ez hasonló, annyival hogy ez 20Mp múlva restartol, és visszaszámol:
OnPlayerCommandText ALÁ:
 
   if (strcmp(cmd, \"/carresi\", true) == 0 || strcmp(cmd, \"/carr\", true) == 0)
{
    if(IsPlayerConnected(playerid))
{
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
              GameTextForAll(\"~w~hamarosan carresi!\",2000,1);
      SetTimer(\"Go20\", 1000, 0);
      SetTimer(\"Go19\", 2000, 0);
      SetTimer(\"Go18\", 3000, 0);
      SetTimer(\"Go17\", 4000, 0);
      SetTimer(\"Go16\", 5000, 0);
      SetTimer(\"Go15\", 6000, 0);
      SetTimer(\"Go14\", 7000, 0);
      SetTimer(\"Go13\", 8000, 0);
      SetTimer(\"Go12\", 9000, 0);
      SetTimer(\"Go11\", 10000, 0);
      SetTimer(\"Go10\", 11000, 0);
      SetTimer(\"Go9\", 12000, 0);
      SetTimer(\"Go8\", 13000, 0);
      SetTimer(\"Go7\", 14000, 0);
      SetTimer(\"Go6\", 15000, 0);
      SetTimer(\"Go5\", 16000, 0);
      SetTimer(\"Go4\", 17000, 0);
      SetTimer(\"Go3\", 18000, 0);
      SetTimer(\"Go2\", 19000, 0);
      SetTimer(\"Go1\", 20000, 0);
        SetTimer(\"VehicleReset\", 21000,0);
        SetTimer(\"CarresetMessage\", 21100,0);
                SendClientMessage(playerid, COLOR_BLUE,\"Carresi Elindítva\");
    }
   else
      return SendClientMessage(playerid,COLOR_GRAD1,\"   Nem vagy Admin\");
}
return 1;
}

 
Ezt a Modod Elejére ahol a többi forward van... (ha van xd):
 
//---------resi--------
forward Go20();
forward Go19();
forward Go18();
forward Go17();
forward Go16();
forward Go15();
forward Go14();
forward Go13();
forward Go12();
forward Go11();
forward Go10();
forward Go9();
forward Go8();
forward Go7();
forward Go6();
forward Go5();
forward Go4();
forward Go3();
forward Go2();
forward Go1();
forward CarresetMessage();
forward VehicleReset();
//---------

 
És a Gamemod Végére:
 
public Go20()
{
GameTextForAll(\"~w~Carresi:~r~20\",2000,3);
return 1;
}
public Go19()
{
GameTextForAll(\"~w~Carresi:~r~19\",2000,3);
return 1;
}
public Go18()
{
GameTextForAll(\"~w~Carresi:~r~18\",2000,3);
return 1;
}
public Go17()
{
GameTextForAll(\"~w~Carresi:~r~17\",2000,3);
return 1;
}
public Go16()
{
GameTextForAll(\"~w~Carresi:~r~16\",2000,3);
return 1;
}
public Go15()
{
GameTextForAll(\"~w~Carresi:~r~15\",2000,3);
return 1;
}
public Go14()
{
GameTextForAll(\"~w~Carresi:~r~14\",2000,3);
return 1;
}
public Go13()
{
GameTextForAll(\"~w~Carresi:~r~13\",2000,3);
return 1;
}
public Go12()
{
GameTextForAll(\"~w~Carresi:~r~12\",2000,3);
return 1;
}
public Go11()
{
GameTextForAll(\"~w~Carresi:~r~11\",2000,3);
return 1;
}
public Go10()
{
GameTextForAll(\"~w~Carresi:~r~10\",2000,3);
return 1;
}
public Go9()
{
GameTextForAll(\"~w~Carresi:~r~9\",2000,3);
return 1;
}
public Go8()
{
GameTextForAll(\"~w~Carresi:~r~8\",2000,3);
return 1;
}
public Go7()
{
GameTextForAll(\"~w~Carresi:~r~7\",2000,3);
return 1;
}
public Go6()
{
GameTextForAll(\"~w~Carresi:~r~6\",2000,3);
return 1;
}
public Go5()
{
GameTextForAll(\"~w~Carresi:~r~5\",2000,3);
return 1;
}
public Go4()
{
GameTextForAll(\"~w~Carresi:~r~4\",2000,3);
return 1;
}
public Go3()
{
GameTextForAll(\"~w~Carresi:~r~3\",2000,3);
return 1;
}
public Go2()
{
GameTextForAll(\"~w~Carresi:~r~2\",2000,3);
return 1;
}
public Go1()
{
GameTextForAll(\"~w~Carresi:~r~1\",2000,3);
return 1;
}
public CarresetMessage() //By Rolee
{
SendClientMessageToAll(COLOR_GREEN,\"<<< Minden használaton kívüli Jármu Visszavontatva >>>\");
return 1;
}
stock IsVehicleOccupied(vehicleid) //By Rolee
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInVehicle(i,vehicleid)) return 1;
}
return 0;
}
public VehicleReset()
{
for(new vehicleid=0;vehicleid<MAX_VEHICLES; vehicleid++)
{
if(!IsVehicleOccupied(vehicleid))
{
    SetVehicleToRespawn(vehicleid);
    engineOn[vehicleid]=false;
}
}
}

 
U.I: Remélem nem kúrtam el...:P Javítsátok ki ha igen..

Nem elérhető DrAkE

  • 2078
    • Profil megtekintése
Carrespawn parancsra.
« Válasz #4 Dátum: 2010. július 18. - 12:11:26 »
0 Show voters
http://the-shadow2010.pastebin.com/UTqTieaV Egyrészt, Másrész: minek íord külön amikor lehet egybe is az egészet? Harmad részt meg ha nem látnád sztem már válaszoltak elegen rá

Nem elérhető Iceaac

  • 2187
    • Profil megtekintése
Carrespawn parancsra.
« Válasz #5 Dátum: 2010. július 29. - 11:54:50 »
0 Show voters
Ez teljesen hülyeség  1 timerrel is meg lehet oldani.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal