[HELP] /sellgun with dcmd
#4

Here's my new code with sscanf.

Код:
dcmd_sellgun( playerid, params[] )
{
	new otherid, wepname[50];
	new string[64], PlayerName[24];
	new number;
	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
	format(string, sizeof(string),"xadmin/Users/%s.ini", udb_encode(PlayerName));
	number = dini_Int(string, "Job");
	

	if(sscanf(params, "us", otherid, wepname))
	{
 		if(number == 6)
		{
			if(otherid == INVALID_PLAYER_ID)
			{
		    	SendClientMessage(playerid, CHAT_COLOR_RED, "Invalid Player ID!");
			}
			else
			{
			    SendClientMessage(playerid, CHAT_COLOR_RED, "Works");
			}
		}
	}
	
	else
	{
		if(number == 6)
		{
		    SendClientMessage(playerid, CHAT_COLOR_RED, "Gun List");
		}
		else if(number != 6)
		{
		    SendClientMessage(playerid, CHAT_COLOR_RED, "You are not an Arms Dealer!");
		}
	}

	return 1;
}
When I do /sellgun when my job isn't Arms Dealer (job 6), it shows nothing. If I do /sellgun with no extra parameters as an arms dealer, it jump to the "Works" part of the code, when it should go to "Gun List". If I type /sellgun (targetid) (gun name), it jumps to the "Gun List" part.

I am so confused. Are there no better ways to do this? :P

Thanks!
Reply


Messages In This Thread
[SOLVED] /sellgun with dcmd - by Haegon - 26.11.2010, 22:12
Re: [HELP] /sellgun with dcmd - by Faraday - 26.11.2010, 22:31
Re: [HELP] /sellgun with dcmd - by Haegon - 26.11.2010, 23:30
Re: [HELP] /sellgun with dcmd - by Haegon - 27.11.2010, 00:08
Re: [HELP] /sellgun with dcmd - by Fj0rtizFredde - 27.11.2010, 00:32
Re: [HELP] /sellgun with dcmd - by Haegon - 27.11.2010, 01:36
Re: [HELP] /sellgun with dcmd - by Haegon - 28.11.2010, 21:03
Re: [HELP] /sellgun with dcmd - by Fj0rtizFredde - 28.11.2010, 22:17
Re: [HELP] /sellgun with dcmd - by Haegon - 28.11.2010, 22:36
Re: [HELP] /sellgun with dcmd - by Richard Steinheimer - 12.08.2012, 03:06

Forum Jump:


Users browsing this thread: 5 Guest(s)