Hello all.
Ma reggel nagyon unatkoztam.Gondoltam osszedobok egy kis Vote Scriptet.Hat sikerult.Itt van.
Teszteltem mukodik.Hasznaljatok egeszseggel.
[pawn] #include <a_samp>
#define VOTE_DIALOG 80
#define VOTE_DIALOG2 81
new IgenVote[MAX_PLAYERS];
new NemVote[MAX_PLAYERS];
forward Nullaz(playerid);
public OnFilterScriptInit()
{
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, \"/vote\", true, 3))
{
if(IsPlayerAdmin(playerid)) {
ShowPlayerDialog(playerid,VOTE_DIALOG,DIALOG_STYLE_INPUT,\"{0e88f2}Szavazas\",\"{f20e0e}Ird be ide a kerdesed.\\nA kerdes Igenre vagy nemre valaszoljon:\",\"Kesz\",\"Megse\");
} else {
SendClientMessage(playerid, 0xFFFFFFFF, \"Neked ezt nem szabad\");
}
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new pname[MAX_PLAYER_NAME], string[100 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if(dialogid == VOTE_DIALOG)
{
if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, \"Szoval megsem akarsz szavazast?\");
new message[128];
format(message, sizeof(message), \"{0e88f2}A kerdes:{f20e0e} %s\", inputtext);
SendClientMessageToAll(0xFFFFFFFF, message);
SetTimer(\"Nullaz\", 30000, 0);
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerDialog(i,VOTE_DIALOG2,DIALOG_STYLE_MSGBOX,\"{0e88f2}Szavazas\",message,\"Igen\",\"Nem\");
return 1;
}
if(dialogid == VOTE_DIALOG2)
{
if(response)
{
for(new i = 0; i < MAX_PLAYERS; i++) IgenVote
++;
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
for(new i = 0; i < MAX_PLAYERS; i++) format(string,sizeof(string),\"[Vote]:{0e75f2}%s az Igenre szavazott{21f20e}(Osszesen: {f20e0e}Igen- %d {0e75f2}Nem- %d{21f20e})\",pname, IgenVote, NemVote);
SendClientMessageToAll(0xFFFF00AA,string);
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++) NemVote++;
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
for(new i = 0; i < MAX_PLAYERS; i++) format(string,sizeof(string),\"[Vote]:{0e75f2}%s a Nemre szavazott{21f20e}(Osszesen: {f20e0e}Igen- %d {0e75f2}Nem- %d{21f20e})\",pname, IgenVote, NemVote);
SendClientMessageToAll(0xFFFF00AA,string);
}
return 1;
}
return 0;
}
public Nullaz(playerid)
{
new pname[MAX_PLAYER_NAME], string[100 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
for(new i = 0; i < MAX_PLAYERS; i++) format(string,sizeof(string),\"[Vote]:{0e75f2} szavazas veget ert.{21f20e}Az eredmeny:{f20e0e}Igen- %d {0e75f2}Nem- %d\",IgenVote, NemVote);
SendClientMessageToAll(0xFFFF00AA,string);
for(new i = 0; i < MAX_PLAYERS; i++) NemVote = 0;
for(new i = 0; i < MAX_PLAYERS; i++) IgenVote = 0;
return 1;
}
[/pawn]
Letoltes: http://www.megaupload.com/?d=H8B2NTZE