Jump to content

Cum poti seta o comanda blocata / deblocata (/startwar, /attack)


Yashin Adevaratu

Recommended Posts

Salut, astazi vreau sa va prezint un tutorial, cam cum puteti creea o comanda de tip /stopwar
sa dati disable la war-uri, etc.

Adaugam in gamemode pe la inceput:

new stopwar;

Mergem la OnGameModeIni si adaugam:

stopwar = 0;

Apoi mergem la comenzi si facem dupa urmatorul exemplu, 

CMD:stopwar(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 5) {
if(stopwar == 0)
{
stopwar = 1; // disable war
//Aici adaugati mesaj daca vreti
SCM(playerid, -1, "Ai dezactivat war-urile.");
}
else {
stopwar = 0; // active war
//Aici adaugati mesaj daca vreti
SCM(playerid, -1, "Ai activat war-urile.");
}
}
else return SCM(playerid, -1, "Trebuie sa fii admin pentru a putea folosi comanda asta!");
return 1;
}

La comanda voastra de /attack adaugati urmatoarea verificare: 

if(stopwar == 1) return SCM(playerid, -1, "War is disable.");

E ceva basic, ceea ce oricine cu cunostinte minime in pawn poate face, succes.

Edited by Yashin Adevaratu
Link to comment
Share on other sites

Din start e gresit si nu va functiona, nu ai nevoie de variabila stopwar ca vector deci sterge  [max_players] si [playerid]

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.