Convert dcmd to zcmd+sscanf
#9

I found the problem, it was my stupid fault of not loading the sscanf plugin in the server config -.-

Well doing that, i made a /giveweapon command, the only thing is, it keeps saying: You have to be level 3 to use that command!

This is the giveweapon code
Code:
	CMD:giveweapon(playerid, params[])
	{
	    if(PInfo[playerid][Level] > 3)
		{
		    new PID;
		    new gun;
		    new ammo;
		    new str[128];
		    new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
		    GetPlayerName(playerid, Adminname, sizeof(Adminname));
		    GetPlayerName(PID, Playername, sizeof(Playername));
		    if(sscanf(params, "us[64]", PID, gun, ammo)) return SendClientMessage(playerid, ORANGE, "USAGE: /giveweapon [playerid][weaponid][ammo]");
				if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, ORANGE, "Player is not connected!");
				format(str, sizeof(str), "'%s' gave weapons to '%s'.", Adminname, Playername);
				SendClientMessageToAll(GREEN, str);
				GivePlayerWeapon(PID, gun, ammo);
			}
 			else
	 		{
				SendClientMessage(playerid, ORANGE, "You have to be level 3 to use that command!");
	 		}
	    return 1;
	}
Reply


Messages In This Thread
Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 17:53
Re: Convert dcmd to zcmd+sscanf - by ]Rafaellos[ - 28.03.2016, 18:10
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 18:13
Re: Convert dcmd to zcmd+sscanf - by iKevin - 28.03.2016, 18:16
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 18:21
Re: Convert dcmd to zcmd+sscanf - by ]Rafaellos[ - 28.03.2016, 18:23
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 18:27
Re: Convert dcmd to zcmd+sscanf - by iKevin - 28.03.2016, 19:31
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 19:59
Re: Convert dcmd to zcmd+sscanf - by iKevin - 28.03.2016, 20:03

Forum Jump:


Users browsing this thread: 1 Guest(s)