[HELP] /refilladm command
#1

hello
can anybody make a /refilladm command for admins
the can do everywhere do the command!
this is the normal command:
Код:
if(strcmp(cmd, "/refill", true) == 0)
	{
	  if(IsPlayerConnected(playerid) == 1)
	  {
	    if(IsPlayerInAnyVehicle(playerid) == 1)
	    {
	      if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	      {
         if(IsAtGasStation(playerid) == 1)
	        {
	          if(GetVehType(GetPlayerVehicleID(playerid)) == 4)
	          {
							SendPlayerRandomizeText(playerid,GREENIE,GAS_SERVICE_TEXT);
	        		TogglePlayerControllable(playerid,0); ChoosingGas[playerid] = 1;
						}
						else
						{
						  SendMessage(playerid,WHITE,"[*] You can't fill this vehicle.");
						}
	        }
	        else
	        {
	          SendMessage(playerid,WHITE,"[*] You're not at Gas station.");
	        }
	      }
	      else
	      {
	        SendMessage(playerid,WHITE,"[*] You're not a driver.");
	      }
	    }
			else
	    {
				SendMessage(playerid,WHITE,"[*] You're not in a vehicle.");
	    }
	  }
	  return 1;
	}
	return 0;
}
Reply
#2

Can't help much not knowing your script at all;

pawn Код:
if(strcmp(cmd, "/refilladm", true) == 0)
{
  if(IsPlayerAdmin(playerid))
  {
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
      Fuel[GetPlayerVehicleID(playerid)] = 999; // Change the array name & value to the correct ones
      return SendMessage(playerid,WHITE,"[*] Vehicle refilled.");
    }
    else return SendMessage(playerid,WHITE,"[*] You're not driving a vehicle.");
  }
  else return SendMessage(playerid,WHITE,"[*] You're not an admin.");
}
BTW, if you cannot do this easy code (just about adding IsPlayerAdmin() in the code), I really think you shouldn't be scripting gamemodes at all. First learn to script, then start making gamemodes. I bet this your gamemode is a GF-edit anyway.
Reply
#3

it's a filterscript
and if i do it there is standing errors!
EDIT:it don't work!
there is standing: you are not an admin!
Reply
#4

Quote:
Originally Posted by breakpaper
it's a filterscript
and if i do it there is standing errors!
EDIT:it don't work!
there is standing: you are not an admin!
You have to login as an RCON Administrator. (/rcon login)
Reply
#5

can't you make a /refilladm for admin's from level 1?
so by name.ini and there in:
adminlevel=1
and then you can do /refilladm
Reply
#6

Put this anywhere
pawn Код:
stock PlayerName(playerid) {
 GetPlayerName(playerid, name, 255);
 return name;
}
pawn Код:
if(strcmp(cmd, "/refilladm", true) == 0)
{
  if(dini_Get(PlayerName(playerid), "adminlevel") >= 1)
  {
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
      Fuel[GetPlayerVehicleID(playerid)] = 999; // Change the array name & value to the correct ones
      return SendMessage(playerid,WHITE,"[*] Vehicle refilled.");
    }
    else return SendMessage(playerid,WHITE,"[*] You're not driving a vehicle.");
  }
  else return SendMessage(playerid,WHITE,"[*] You're not an admin.");
}
Based of Finn's reply
Untested, might not work.
Also you should get the PlayerName thingy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)