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

Deathrun


  • Zamknięty Temat jest zamknięty
Brak odpowiedzi do tego tematu

#1 Monsulito

    Profesjonalista

  • Użytkownik

Reputacja: 17
Początkujący

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

Napisano 21.04.2010 21:05

Cześć. Zwracam sie do was o pomoc. Otóz mam taki plugin

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

new bool:isrestart = false
//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 bronie i 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;
}

I jak zrobic ze jak wyjdzie w vote "Tak". to nie bedzie mozna uruchamiac pulapke.
cos z tym?

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

A i 2 pytanie jak zrobić żeby dało sie wpisac /free tylko 3 razy na runde.

23 kwiecień 2010 - 14:03:
Reup

23 kwiecień 2010 - 22:12:
Reup
  • +
  • -
  • 0
RPG MOD - [||||||||||] 5%




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

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