Kezdőoldal » Számítástechnika » Programozás » Miért nem működik a /restart...

Miért nem működik a /restart parancs a PPC_Trucking modba Samp szerveren?

Figyelt kérdés

Megtaláltam a parancsot a PPC_PlayerCommands.inc-be de nem tudom hogy kell átírni hogy működjön is.

van egy olyan rész benne hogy:

SendRconCommand("hostname Pending Restart");

SendRconCommand("password loafkagakggoagka");

ez egy publikált verzió és ezt banne hagyták.

az első sorba Pending Restart helyére kell valami?

a második sorba a password után gondolom az rcon jelszó kellene ha jól értem.

aki tudja mit kellene ide irni légyszi irjon!



2014. jún. 16. 14:41
 1/1 A kérdező kommentje:

// Restarts the server

COMMAND:restart(playerid, params[])

{

// Send the command to all admins so they can see it

SendAdminText(playerid, "/restart", params);


// Check if the player has logged in

if (APlayerData[playerid][LoggedIn] == true)

{

// Check if the player's admin-level is at least 5

if (APlayerData[playerid][PlayerLevel] >= 5)

{

// Let everyone know that the server will be restarted in 2 minutes

GameTextForAll("Szerver 2 perc mulva ujraindul!", 5000, 3);

SendClientMessageToAll(0xA0A0A0, "Szerver 2 perc mulva ujraindul!");

// Start the next timer which warns the players again that server will be restarted in 1 minute

SetTimer("Timer_Restart_WarnPlayers", 1000 * 60, false);

}

else

return 0;

}

else

return 0;


// Let the server know that this was a valid command

return 1;

}


forward Timer_Restart_WarnPlayers();

public Timer_Restart_WarnPlayers()

{

// Let everyone know that the server will be restarted in 1 minutes

GameTextForAll("Szerver 1 perc mulva ujraindul!", 5000, 3);

SendClientMessageToAll(0xA0A0A0, "Szerver 1 perc mulva ujraindul!");

// Start the next timer

SetTimer("Timer_Restart_Kick", 1000 * 60, false);

// Change the hostname of the server and it's password

SendRconCommand("hostname Pending Restart");

SendRconCommand("password loafkagakggoagka");


return 1;

}


forward Timer_Restart_Kick();

public Timer_Restart_Kick()

{

// Let everyone know that the server is kicking all players before restarting

GameTextForAll("Szerver ujraindult kickeltunk mindenkit...!", 5000, 3);

// Kick all players

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

Kick(i);


// Start the next timer that will restart the server

SetTimer("Timer_Restart_Reboot", 1000 * 5, false);


return 1;

}


forward Timer_Restart_Reboot();

public Timer_Restart_Reboot()

{

new HostCommand[128];


// Restart the server

SendRconCommand("gmx");

// Change the hostname and password again

format(HostCommand, 128, "hostname %s", GameModeName);

SendRconCommand(HostCommand);

SendRconCommand("password 0");


return 1;

}


Ez az egész kód

2014. jún. 16. 14:42

Kapcsolódó kérdések:





Minden jog fenntartva © 2024, www.gyakorikerdesek.hu
GYIK | Szabályzat | Jogi nyilatkozat | Adatvédelem | Cookie beállítások | WebMinute Kft. | Facebook | Kapcsolat: info(kukac)gyakorikerdesek.hu

A weboldalon megjelenő anyagok nem minősülnek szerkesztői tartalomnak, előzetes ellenőrzésen nem esnek át, az üzemeltető véleményét nem tükrözik.
Ha kifogással szeretne élni valamely tartalommal kapcsolatban, kérjük jelezze e-mailes elérhetőségünkön!