Newbie; /makeadmin help [REP++]
#1

I made a command called /makeadmin and made another command called /admin to show you your admin level.

and made a simple command called /goto. /makeadmin says that I was promoted to level 1 for example, but /admin shows 0 and /goto isn't working.

tl;dr, what's wrong in these commands


Код:
CMD:makeadmin(playerid, params[])
{
	if(IsPlayerAdmin(playerid))
	{
	    new targetid, level, string[70];
	    if(sscanf(params, "ui", targetid, level)) return SendClientMessage(playerid, 0xFFFFFF, "You aren't an admin");
	    if(level > 10 || level < 0) return SendClientMessage(playerid, 0xFFFFFF, "You can't do that");
	    if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFF, "Invalid Name/ID");
		level = admin[targetid];
		format(string, sizeof(string), "You have been promoted to level [%i] administration", level);
		SendClientMessage(playerid, 0xFFFFFF, string);
	    return 1;
	}
	else
	{
	    SendClientMessage(playerid, 0xFFFFFF, "You aren't an admin");
	    return 1;
	}
}
Код:
CMD:goto(playerid, params[])
{
	if(IsPlayerAdmin(playerid) || admin[playerid] >= 1) // mhe kant kda mn el 2wl 5als, dumb-.- la2a kant admin(playerid) noob. not admin[playerid] ehda ba2a we bye
	{
		new targetid; new Float:x, Float:y, Float:z;
		if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /goto <ID/Name>");
		if(targetid == playerid) return SendClientMessage(playerid, COLOR_YELLOW, "You can't go to yourself");
		if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_BLACK, "Invalid ID/Name");
		GetPlayerPos(targetid, x, y, z);
  		SetPlayerPos(playerid, x+1, y, z);
    	SendClientMessage(playerid, COLOR_PINK, "You have been TelePorted");
		return 1;
	}
	else
	{
        SendClientMessage(playerid, COLOR_BLACK, "you aren't an admin");
	}
	return 1;
}
Reply
#2

aheda b2a w wriny el enum bta3t el PlayerInfo
Reply
#3

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
aheda b2a w wriny el enum bta3t el PlayerInfo
This is English section, NOT Arabic.
Reply
#4

i didn't make an enum, i only did a variable.

Quote:

new admin[MAX_PLAYERS];

and at that nigga who said speak english, i want him to speak arabic. don't interfere please, if he is going to fix it like that
Reply
#5

First: try it ike that
PHP код:
admin[targetid] = level
Second: Stunn if we found one we will talk in it :P
Reply
#6

Try to use
pawn Код:
admin[targetid] = level;
in your makeadmin command.

EDIT: Sorry, didn't see nezo.
Reply
#7

thanks nezoo, he fixed it. thanks for the additional help guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)