Raised This Month: $ Target: $400
 0% 

Why in this code bonus doesn't work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
danonix
Senior Member
Join Date: Dec 2012
Old 11-23-2014 , 15:25   Why in this code bonus doesn't work
Reply With Quote #1

Hello, I have changed a bit code from surf-desk, to earn bonus from npc, but only bonus is error, and I'm not receiving bonus from NPC ( for example model )etc.
Can someone analize this ? please

Exactly this:
Code:
L 11/23/2014 - 10:23:25: String formatted incorrectly - parameter 4 (total 3)
L 11/23/2014 - 10:23:25: [AMXX] Displaying debug trace (plugin "mikolaj.amxx")
L 11/23/2014 - 10:23:25: [AMXX] Run time error 25: parameter error 
L 11/23/2014 - 10:23:25: [AMXX]    [0] colorchat.inc::ColorChat (line 51)
L 11/23/2014 - 10:23:25: [AMXX]    [1] mikolaj.sma::SprawdzPrezent (line 129)
L 11/23/2014 - 10:23:25: [AMXX]    [2] mikolaj.sma::npcMenuEnter (line 185)
I have got this piece of code
Code:
public plugin_init(){
register_menucmd(register_menuid("npcMenu"), menuKeys, "npcMenuEnter");
}

....

public SprawdzPrezent(id)
{
	if(is_user_alive(id))	
	{
		NieDostal[id] = true;
		new prezent = random_num(0, 7);
		switch(prezent){
			case 0:{

			}

			}
			case 2: {
				ColorChat(id, GREEN, "[%s]^x01 Swiatecznie dostales prezent - super vipa na jedna mape!")
				set_user_flags(id, get_user_flags(id) | ADMIN_LEVEL_G);
				server_cmd("amx_reloadadmins");
			}
			case 3: {

			}
			case 4: {
			}
			case 5: {
			}
			case 6: {
			}
			case 7: {

			}
			
		}
	}
	return FMRES_HANDLED;
}

//////////////////////////////////////////////
// NPC STUFF
//////////////////////////////////////////////
public npcMenu(id)
{
	if(get_user_flags(id) & ADMIN_IMMUNITY){
		new name[33], text[512];
		
		get_user_name(id, name, 32);
		format(text, 511, "Witaj %s!^n^nHave you got present?t?\y^n^n1: No   -   2: Yes", name);
		
		show_menu(id, menuKeys, text, -1, "npcMenu");
		return FMRES_HANDLED;
	}
	return PLUGIN_CONTINUE
}

public npcMenuEnter(id, key)
{
	switch(key)
	{
		case 0:
		{	
			if(!NieDostal[id]) SprawdzPrezent(id);
			else ColorChat(id, GREEN, "[%s]You took present already!", PREFIX);
			inMenu[id] = false;
		}
		case 1:
		{
			inMenu[id] = false;
		}
	}
}

Last edited by danonix; 11-23-2014 at 15:26.
danonix is offline
 


Thread Tools
Display Modes

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 17:41.


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