help with id!
#1

this command is work and all good no erros but what is the problem when i do in the game

/setlevel (playerid) (level)
Exampel
/setlevel 3 1

its tell me

SERVER: UNKNOWN COMMAND


Код:
dcmd_setlevel(playerid, params[])
{
	new Level, pID, pName[24], str[128], PlayerFile[100];

	if(Player[playerid][admin] < 5) return SendClientMessage(playerid, COLOR_RED, "You Dont Have Right To Use This Command");
	if(sscanf(params, "ud",playerid, Level)) return SendClientMessage(playerid, COLOR_RED, "|| Usage: /setlevel [playerid] [level] ||");
	GetPlayerName(playerid, pName, sizeof(pName));
	format(PlayerFile, sizeof(PlayerFile), "maxadmin/users/%s.ini", pName);
	if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
	if(!dini_Exists(PlayerFile)) return SendClientMessage(playerid, COLOR_RED, "That player isn't registered!");
	if(Player[playerid][admin] == Level) return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is moderator already!");
	
	if(Level == 1)
	{
 		format(str, sizeof(str), "You have promoted %s to a staff team", pName);
		SendClientMessage(playerid, COLOR_GREEN, str);
		format(str, sizeof(str), "You have prometed to a staff team status.", pName);
		SendClientMessage(pID, COLOR_GREEN, str);
		Player[playerid][admin] = 1;
		dini_IntSet(PlayerFile, "Level", 1);
	}
	return 1;
}
Reply
#2

on OnPlayerCommandText add:

pawn Код:
dcmd(setlevel,8,cmdtext);
Reply
#3

added and stilll
Reply
#4

Other commands work good?
Reply
#5

yea all workd good now if someone join as id 3 so when i do /setlevel 3 3 its work when he left and if i do /setlevel 3
its say UNKNOWN COMMAND
Reply
#6

Could you show us your code?
Reply
#7

give me your email
Reply
#8

You can post here, or send me forum PM.
Reply
#9

add me in your email

Thift@live.com

i will let you join my server by hamachi
Reply
#10

Change
Код:
if(sscanf(params, "ud",playerid, Level)) return SendClientMessage(playerid, COLOR_RED, "|| Usage: /setlevel [playerid] [level] ||");
if(Player[playerid][admin] == Level) return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is moderator already!");
to

Код:
if(sscanf(params, "ud",pID, Level)) return SendClientMessage(playerid, COLOR_RED, "|| Usage: /setlevel [playerid] [level] ||");
if(Player[pID][admin] == Level) return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is moderator already!");
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)