Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Prośba o przerobke


  • Zamknięty Temat jest zamknięty
6 odpowiedzi w tym temacie

#1 Monsulito

    Profesjonalista

  • Użytkownik

Reputacja: 17
Początkujący

  • Postów:201
  • Lokalizacja:Gdańsk
Offline

Napisano 27.04.2010 10:09

Witam chciałbym aby plugin blokowal wszystkie pulapki. Gdy w vote wyjdzie "Tak". A oto plugin :

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>

//This will hold the VoteMenu
new gVoteMenu;
//This will hold the votes for each option
new gVotes[2];
//This determines if a vote is already happening
new gVoting;

public plugin_init(){


register_clcmd("say /free","freerun"),
RegisterHam(Ham_Use, "func_button", "ButtonUse");
//Register a way to get to your vote...

}
public ButtonUse(ent, id){

if (get_user_team(id)==1) return HAM_SUPERCEDE
return PLUGIN_HANDLED
}

public freerun(id)
{
if( get_user_team( id ) == 1 )
StartVote(id)
else
client_print(id, print_chat, "Ta komenda jest tylko dostepna dla Terrorysty!")
}

public StartVote(id)
{
//If there is already a vote, don't start another
if( gVoting )
{
client_print(id, print_chat, "There is already a vote going.");
//We return PLUGIN_HANDLED so the person does not get Unknown Command in console
return PLUGIN_HANDLED;
}

//Store the menu in the global
gVoteMenu = menu_create("\rCT chce free?!:", "menu_handler");

//Add some vote options
menu_additem(gVoteMenu, "Tak", "0", 0);
menu_additem(gVoteMenu, "Nie", "1", 0);

//We will need to create some variables so we can loop through all the players
new players[32], pnum, tempid;

//Fill players with available players
get_players(players, pnum);

//Start looping through all players to show the vote to
for( new i; i<pnum; i++ )
{
//Save a tempid so we do not re-index
tempid = players[i];

//Show the vote to this player
menu_display(tempid, gVoteMenu, 0);

//Increase how many players are voting
gVoting++;
}

//End the vote in 10 seconds
set_task(10.0, "EndVote");

return PLUGIN_HANDLED;
}
public menu_handler(id, menu, item)
{
//If the menu was exited or if there is not a vote
if( item == MENU_EXIT || !gVoting )
{
//Note were not destroying the menu
return PLUGIN_HANDLED;
}

new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

//Get the id of the player that was selected
new voteid = str_to_num(data);

//Increase the votes for what they selected
gVotes[voteid]++;

//Note were not destroying the menu
return PLUGIN_HANDLED;
}
public EndVote()
{
//If the first option recieved the most votes
if( gVotes[0] > gVotes[1] )
client_print(0, print_chat, "CT Chce Free, wszystkie pulapki zablokowane :)!", gVotes[0] )
//Else if the second option recieved the most votes
else if( gVotes[0] > gVotes[1] )
client_print(0, print_chat, "CT Nie chce Free, gramy normalnie dalej :)!", gVotes[1] );

//Otherwise the vote tied
else
client_print(0, print_chat, "CT Nie chce Free, gramy normalnie dalej :)!", gVotes[0] );

//Don't forget to destroy the menu now that we are completely done with it
menu_destroy(gVoteMenu);

//Reset that no players are voting
gVoting = 0;
}


Z góry dzięki

Użytkownik Monsulito edytował ten post 27.04.2010 10:10

  • +
  • -
  • 0
RPG MOD - [||||||||||] 5%

#2 G[o]Q

    I'm G[o]Q

  • Przyjaciel

Reputacja: 1 344
Godlike

  • Postów:3 563
  • Steam:steam
  • Imię:Krzysiek
  • Lokalizacja:C: / program Files / Valve / Cstrike / G[o]Q.dem
Offline

Napisano 27.04.2010 15:52

#include <amxmodx>

#include <amxmisc>

#include <hamsandwich>

#include <fun>



 //This will hold the VoteMenu

 new gVoteMenu;

 //This will hold the votes for each option

 new gVotes[2];

new blokuj

 //This determines if a vote is already happening

 new gVoting;



public plugin_init(){

  

   

   register_clcmd("say /free","freerun"),

   RegisterHam(Ham_Use, "func_button", "ButtonUse");

       //Register a way to get to your vote...

      register_logevent("roundstart",2,1="Round_Start")

}

public roundstart(){

    blokuj--

}

public ButtonUse(ent, id){

(blokuj && cs_get_user_team(id)==1)? return HAM_SUPERCEDE:return PLUGIN_HANDLED

}



public freerun(id)

{

        if( get_user_team( id ) == 1 )

        StartVote(id)

        else

        client_print(id, print_chat, "Ta komenda jest tylko dostepna dla Terrorysty!")

        }



 public StartVote(id)

 {

    //If there is already a vote, don't start another

    if( gVoting )

    {

        client_print(id, print_chat, "There is already a vote going.");

        //We return PLUGIN_HANDLED so the person does not get Unknown Command in console

        return PLUGIN_HANDLED;

    }



    //Store the menu in the global

    gVoteMenu = menu_create("\rCT chce free?!:", "menu_handler");



    //Add some vote options

    menu_additem(gVoteMenu, "Tak", "0", 0);

    menu_additem(gVoteMenu, "Nie", "1", 0);



    //We will need to create some variables so we can loop through all the players

    new players[32], pnum, tempid;



    //Fill players with available players

    get_players(players, pnum);



    //Start looping through all players to show the vote to

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

    {

        //Save a tempid so we do not re-index

        tempid = players[i];



        //Show the vote to this player

        menu_display(tempid, gVoteMenu, 0);



        //Increase how many players are voting

        gVoting++;

    }



    //End the vote in 10 seconds

    set_task(10.0, "EndVote");



    return PLUGIN_HANDLED;

 }

 public menu_handler(id, menu, item)

 {

    //If the menu was exited or if there is not a vote

    if( item == MENU_EXIT || !gVoting )

    {

        //Note were not destroying the menu

        return PLUGIN_HANDLED;

    }



    new data[6], iName[64];

    new access, callback;

    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);



    //Get the id of the player that was selected

    new voteid = str_to_num(data);



    //Increase the votes for what they selected

    gVotes[voteid]++;



    //Note were not destroying the menu

    return PLUGIN_HANDLED;

 }

 public EndVote()

 {

    //If the first option recieved the most votes

    if( gVotes[0] > gVotes[1] ){

        client_print(0, print_chat, "CT Chce Free, wszystkie pulapki zablokowane <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' />!", gVotes[0] )

        blokuj++ 

    }    

//Else if the second option recieved the most votes

    else if( gVotes[0] > gVotes[1] )

        client_print(0, print_chat, "CT Nie chce Free, gramy normalnie dalej <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' />!", gVotes[1] );



    //Otherwise the vote tied

    else

        client_print(0, print_chat, "CT Nie chce Free, gramy normalnie dalej <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' />!", gVotes[0] );



    //Don't forget to destroy the menu now that we are completely done with it

    menu_destroy(gVoteMenu);



    //Reset that no players are voting

    gVoting = 0;

 }


  • +
  • -
  • 0
Manual ponad wszystko, konsola ponad manual :D :&

Chcesz wysłać do mnie PW ? użyj nazwy GoQ zamiast G[o]Q
Chcesz Kupić moduł płatności via Pukawka,Tserwery, Gamesol, Zabijaka do mojego sklepu? napisz PW cena to tylko 10 zł/sztuka

GG:6022845 (nie pomagam za free osobom ponizej rangi MoD) :D

#3 Monsulito

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 17
Początkujący

  • Postów:201
  • Lokalizacja:Gdańsk
Offline

Napisano 27.04.2010 17:19

Błędy mi wywala
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 20
Error: Must be lvalue (non-constant) on line 20
Warning: Expression has no effect on line 20
Error: Expected token: ";", but found ")" on line 20
Error: Invalid expression, assumed zero on line 20
Error: Too many error messages on one line on line 20

Compilation aborted.
4 Errors.
Could not locate output file C:\Documents and Settings\user\Pulpit\freerun.amx (compile failed).

Po za tym mi chodzi zeby na poczatku kazdej rundy mozna bylo wlaczac pupaki dopiero po komendzie /free jak wyjdzie w vote TAK zeby byly zablokowane.

Użytkownik Monsulito edytował ten post 27.04.2010 17:36

  • +
  • -
  • 0
RPG MOD - [||||||||||] 5%

#4 G[o]Q

    I'm G[o]Q

  • Przyjaciel

Reputacja: 1 344
Godlike

  • Postów:3 563
  • Steam:steam
  • Imię:Krzysiek
  • Lokalizacja:C: / program Files / Valve / Cstrike / G[o]Q.dem
Offline

Napisano 27.04.2010 18:31

hmm a jest inaczej :?:
Spoiler


myslalem ze instrukcja warunkowa dziala :D
  • +
  • -
  • 0
Manual ponad wszystko, konsola ponad manual :D :&

Chcesz wysłać do mnie PW ? użyj nazwy GoQ zamiast G[o]Q
Chcesz Kupić moduł płatności via Pukawka,Tserwery, Gamesol, Zabijaka do mojego sklepu? napisz PW cena to tylko 10 zł/sztuka

GG:6022845 (nie pomagam za free osobom ponizej rangi MoD) :D

#5 Monsulito

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 17
Początkujący

  • Postów:201
  • Lokalizacja:Gdańsk
Offline

Napisano 27.04.2010 19:22

Tak jest inaczej (teraz sie komplikuje :D). Na poczatku rundy pulapki sa zablokowane bez wpisywania i wyniku vote. Chcialbym zeby bylo po vote jak wyjdzie "Tak" :)

27 kwiecień 2010 - 19:28:
A i bez pluginu sie uruchamiaja. Sprawdzalem :)

Użytkownik Monsulito edytował ten post 27.04.2010 19:27

  • +
  • -
  • 0
RPG MOD - [||||||||||] 5%

#6 G[o]Q

    I'm G[o]Q

  • Przyjaciel

Reputacja: 1 344
Godlike

  • Postów:3 563
  • Steam:steam
  • Imię:Krzysiek
  • Lokalizacja:C: / program Files / Valve / Cstrike / G[o]Q.dem
Offline

Napisano 27.04.2010 19:54

#include <amxmodx>

#include <amxmisc>

#include <hamsandwich>

#include <fun>

#include <cstrike>



 //This will hold the VoteMenu

 new gVoteMenu;

 //This will hold the votes for each option

 new gVotes[2];

new blokuj

 //This determines if a vote is already happening

 new gVoting;



public plugin_init(){

  

   

   register_clcmd("say /free","freerun"),

   RegisterHam(Ham_Use, "func_button", "ButtonUse");

       //Register a way to get to your vote...

   register_logevent("roundstart",2,"1=Round_Start")

}

public roundstart(){

    blokuj=0

}

public ButtonUse(ent, id){

if (blokuj && cs_get_user_team(id)==CS_TEAM_T)return HAM_SUPERCEDE

return PLUGIN_HANDLED

}



public freerun(id)

{

        if( get_user_team( id ) == 1 )

        StartVote(id)

        else

        client_print(id, print_chat, "Ta komenda jest tylko dostepna dla Terrorysty!")

        }



 public StartVote(id)

 {

    //If there is already a vote, don't start another

    if( gVoting )

    {

        client_print(id, print_chat, "There is already a vote going.");

        //We return PLUGIN_HANDLED so the person does not get Unknown Command in console

        return PLUGIN_HANDLED;

    }



    //Store the menu in the global

    gVoteMenu = menu_create("\rCT chce free?!:", "menu_handler");



    //Add some vote options

    menu_additem(gVoteMenu, "Tak", "0", 0);

    menu_additem(gVoteMenu, "Nie", "1", 0);



    //We will need to create some variables so we can loop through all the players

    new players[32], pnum, tempid;



    //Fill players with available players

    get_players(players, pnum);



    //Start looping through all players to show the vote to

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

    {

        //Save a tempid so we do not re-index

        tempid = players[i];



        //Show the vote to this player

        menu_display(tempid, gVoteMenu, 0);



        //Increase how many players are voting

        gVoting++;

    }



    //End the vote in 10 seconds

    set_task(10.0, "EndVote");



    return PLUGIN_HANDLED;

 }

 public menu_handler(id, menu, item)

 {

    //If the menu was exited or if there is not a vote

    if( item == MENU_EXIT || !gVoting )

    {

        //Note were not destroying the menu

        return PLUGIN_HANDLED;

    }



    new data[6], iName[64];

    new access, callback;

    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);



    //Get the id of the player that was selected

    new voteid = str_to_num(data);



    //Increase the votes for what they selected

    gVotes[voteid]++;



    //Note were not destroying the menu

    return PLUGIN_HANDLED;

 }

 public EndVote()

 {

    //If the first option recieved the most votes

    if( gVotes[0] > gVotes[1] ){

        client_print(0, print_chat, "CT Chce Free, wszystkie pulapki zablokowane <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' />!", gVotes[0] )

        blokuj=1

    }    

//Else if the second option recieved the most votes

    else if( gVotes[0] > gVotes[1] )

        client_print(0, print_chat, "CT Nie chce Free, gramy normalnie dalej <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' />!", gVotes[1] );



    //Otherwise the vote tied

    else

        client_print(0, print_chat, "CT Nie chce Free, gramy normalnie dalej <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' />!", gVotes[0] );



    //Don't forget to destroy the menu now that we are completely done with it

    menu_destroy(gVoteMenu);



    //Reset that no players are voting

    gVoting = 0;

 }


  • +
  • -
  • 1
Manual ponad wszystko, konsola ponad manual :D :&

Chcesz wysłać do mnie PW ? użyj nazwy GoQ zamiast G[o]Q
Chcesz Kupić moduł płatności via Pukawka,Tserwery, Gamesol, Zabijaka do mojego sklepu? napisz PW cena to tylko 10 zł/sztuka

GG:6022845 (nie pomagam za free osobom ponizej rangi MoD) :D

#7 Monsulito

    Profesjonalista

  • Autor tematu
  • Użytkownik

Reputacja: 17
Początkujący

  • Postów:201
  • Lokalizacja:Gdańsk
Offline

Napisano 27.04.2010 20:52

dzięki + Dla ciebie
A mogłbys przerobic jeszcze zeby tylko 1 raz na runde mozna bylo wpisac /free

28 kwiecień 2010 - 08:30:
Reup

29 kwiecień 2010 - 14:13:
Reup

30 kwiecień 2010 - 10:11:
Reup

Użytkownik Monsulito edytował ten post 27.04.2010 20:56

  • +
  • -
  • 0
RPG MOD - [||||||||||] 5%




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych