Admin CMD help
#1

Howdy, fellows. Well, I've tried everything and I know that this is basic stuff but how to allow an admin to use a CMD without being on admin-duty? I've tried everything but with no sucess. For example in this command:

Код:
CMD:getcar(playerid, params[])
{
   	if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be on Admin Duty to use this Command!");
	if (PlayerInfo[playerid][pAdmin] >= 3)
	{
		new carid;
		if(sscanf(params, "d", carid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /getcar [carid]");
		new Float:plocx,Float:plocy,Float:plocz;

		GetPlayerPos(playerid, plocx, plocy, plocz);
		SetVehiclePos(carid,plocx,plocy+4, plocz);
		SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
		LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}

What do I have to remove? How many brackets? I hope you can help me with this simple question, cheers.
Reply
#2

Remove
pawn Код:
if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be on Admin Duty to use this Command!");
Reply
#3

Remove this line:

pawn Код:
if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be on Admin Duty to use this Command!");
Edit: Damn... Fast
Reply
#4

Quote:
Originally Posted by Adytza.
Посмотреть сообщение
Remove
pawn Код:
if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be on Admin Duty to use this Command!");
That was the first thing I tried and it gave me some error, let me try that again.
Reply
#5

Remove the line that asks if they're on admin duty...
pawn Код:
CMD:getcar(playerid, params[])
{
    // The one that was here
    if (PlayerInfo[playerid][pAdmin] >= 3)
    {
        new carid;
        if(sscanf(params, "d", carid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /getcar [carid]");
        new Float:plocx,Float:plocy,Float:plocz;

        GetPlayerPos(playerid, plocx, plocy, plocz);
        SetVehiclePos(carid,plocx,plocy+4, plocz);
        SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
        LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}
Edit: Too fast for me
Reply
#6

Wow, this is awkward, now it worked! Thanks a lot, guys.
Reply
#7

By the way, in this command :
Код:
CMD:impound(playerid, params[])
{
	switch(PlayerInfo[playerid][pMember]) {
		case 1, 2, 3, 7, 11: {
			if(!IsAtImpoundingPoint(playerid))
			{
				SendClientMessageEx(playerid, COLOR_GREY, "You are not near the impound point, you can't impound!");
				return 1;
			}
How can I make it only for faction 10? It's restricted to Faction 1, somehow...
Reply
#8

Quote:
Originally Posted by DuarteCambra
Посмотреть сообщение
By the way, in this command : [pawn]CMD:impound(playerid, params[])
{
switch(PlayerInfo[playerid][pMember]) {
case 1, 2, 3, 7, 11: {
if(!IsAtImpoundingPoint(playerid))
{
SendClientMessageEx(playerid, COLOR_GREY, "You are not near the impound point, you can't impound!");
return 1;
}[pawn] How can I make it only for faction 10? It's restricted to Faction 1, somehow...
If you want it only for faction 10 replace this
pawn Код:
case 1, 2, 3, 7, 11:
with this:
pawn Код:
case 10:
Reply
#9

Quote:
Originally Posted by Adytza.
Посмотреть сообщение
If you want it only for faction 10 replace this
pawn Код:
case 1, 2, 3, 7, 11:
with this:
pawn Код:
case 10:
Thanks, mate. Cheers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)