26.03.2009, 15:10
this is a little bit of what i have, i dont understand how to make it check how many votes are what and how to script this kinda thing
Code:
#include <a_samp>
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#if defined FILTERSCRIPT
new Menu:tpm;
new Menu:tpm2;
new Voteyes;
new Voteno;
forward VoteTimer(giveplayerid);
#define COLOR_GREEN 0x33AA33AA
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Gamemode Vote by Andy");
print("--------------------------------------\n");
tpm2 = CreateMenu("Votemenu", 1, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(tpm, 0, "Vote Yes");
AddMenuItem(tpm, 0, "Vote No");
tpm = CreateMenu("Gamemodes", 1, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(tpm, 1, "Stunt Gamemode");
AddMenuItem(tpm, 1, "Roleplay Gamemode");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/votemenu", true) == 0)
{
ShowMenuForPlayer(tpm,playerid);
TogglePlayerControllable(playerid,1);
return 1;
}
return 0;
}
public OnPlayerExitedMenu(playerid)
{
TogglePlayerControllable(playerid,0);
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == tpm)
{
switch(row)
{
case 0:
{
Voteyes = 1;
}
case 1:
{
Voteno = 1;
SendRconCommand("Changemode WC-RP");
}
}
}
return 1;
}
public VoteTimer(giveplayerid)
{
new string[STRING];
if(Votes == 1)
{
format(string, sizeof(string), "Gamemode has been Changed", Name(giveplayerid));
SendClientMessageToAll(YELLOW, string);
SendRconCommand("Changemode WC-RP");
}
else if(Voteno == 1)
return 1;
}
// GivePlayerWeapon(playerid,34,750);

