Unknown command
#1

I made these commands, and each time I try them in game it says SERVER: Unknown command.
Code:

Код:
CMD:givelicense(playerid, params[])
{
	new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], option[7], string[128];
	sendername[strfind(sendername,"_")] = ' ';
	name[strfind(name,"_")] = ' ';
	if(PlayerInfo[playerid][pAdmin] < 1338 || PlayerInfo[playerid][pFaction] >= 1) return SCM(playerid, COLOR_GREY, "You aren't SD or an Admin!");
	if(sscanf(params, "ui", id, option)) return SCM(playerid, COLOR_GREY, "USAGE: /givelicense [id] [Type] (Type 1 = Driver's license | Type 2= Weapons)");
	{
	    if(PlayerInfo[playerid][pFaction] == 1 && PlayerInfo[playerid][pAdmin] > 1338)
	    {
	        if(!strcmp(option, "1", true))
	        {
	            PlayerInfo[id][pDriveLic] = 1;
	            format(string, sizeof(string), "* %s gives %s a driver's license.", sendername, name);
				ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
			if(!strcmp(option, "2", true))
			{
			    PlayerInfo[id][pGunLic] = 1;
			    format(string, sizeof(string), "* %s gives %s a weapons license.", sendername, name);
				ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
		}
	}
	return 1;
}
CMD:takelicense(playerid, params[])
{
	new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], option[7], string[128];
	sendername[strfind(sendername,"_")] = ' ';
	name[strfind(name,"_")] = ' ';
	if(PlayerInfo[playerid][pAdmin] < 1338 || PlayerInfo[playerid][pFaction] >= 1) return SCM(playerid, COLOR_GREY, "You aren't SD or an Admin!");
	if(sscanf(params, "ui", id, option)) return SCM(playerid, COLOR_GREY, "USAGE: /takelicense [id] [Type] (Type 1 = Driver's license | Type 2= Weapons)");
	{
	    if(PlayerInfo[playerid][pFaction] == 1 && PlayerInfo[playerid][pAdmin] > 1338)
	    {
	        if(!strcmp(option, "1", true))
	        {
	            PlayerInfo[id][pDriveLic] = 0;
	            format(string, sizeof(string), "* %s takes %s's drivers license", sendername, name);
				ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
			if(!strcmp(option, "2", true))
			{
			    PlayerInfo[id][pGunLic] = 0;
			    format(string, sizeof(string), "* %s takes %s's weapon license", sendername, name);
				ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
		}
	}
	return 1;
}
Reply
#2

Be sure that you use plugin sscanf, and also try to use SendClientMessage instead ProxDrector...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)