Raised This Month: $ Target: $400
 0% 

dynamic menu_additem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 05-23-2010 , 03:12   dynamic menu_additem
Reply With Quote #1

PHP Code:
StartVote()
{
    new 
i;
    new 
title[65];
    
format(title64"Tech Level %d Vote"iCurrentTechLevel+1);
    
//Store the menu in the global
    
gVoteMenu menu_create(title"menu_handler");
    
    
menu_setprop(gVoteMenuMPROP_EXITMEXIT_NEVER);

    
//Add some vote options
    
    
for(0TECHS_PER_LEVELi++)
    {
        new 
vote[65];
        
format(vote64"%s"szTechName[iCurrentTechLevel][i]);
        
menu_additem(gVoteMenuvotei+10);
    }

    for(
0MAX_PLAYERSi++)
    {
        
bPlayerVoted[i] = false;
    }
    
    
bInVote true;
    
fVoteStartTime get_gametime();
    
    
//We will need to create some variables so we can loop through all the players
    
new players[32], pnumtempid;

    
//Fill players with available players
    
get_players(playerspnum);

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

        
//Show the vote to this player
        
menu_display(tempidgVoteMenu0);

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

    return 
PLUGIN_HANDLED;

Code:
	for(i = 0; i < TECHS_PER_LEVEL; i++)
	{
		new vote[65];
		format(vote, 64, "%s", szTechName[iCurrentTechLevel][i]);
		menu_additem(gVoteMenu, vote, i+1, 0);
	}
Quote:
Error: Argument type mismatch (argument 3) on line 451
__________________
+|- KARMA Respectively

HLM is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-23-2010 , 03:30   Re: dynamic menu_additem
Reply With Quote #2

That argument requires a string, not an integer.
You must convert the integer to a string.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 05-23-2010 , 14:13   Re: dynamic menu_additem
Reply With Quote #3

thanks exolent
__________________
+|- KARMA Respectively

HLM is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-23-2010 , 16:43   Re: dynamic menu_additem
Reply With Quote #4

Some advice: When you have an error like this it is always wise to first check the FuncWiki and if it's not there search for it in the /include/ folder because mose everything is well documented there.

Have fun!
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode