CMD Help
#1

Hey i made a CMD to give GoldRimes and CutterRimes I want only admin's can use that , How can I do that? SOmone can write here with code ? :

Код:
CMD:givegr(playerid, params[])
                {
 				if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,

0xFFFFFFFF, "You are not driving a vehicle.");
				AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
  			    SendClientMessage(playerid, 0xFFFFFFFF, "You have added Gold Rims to your vehicle.");
                return 1;
                }

CMD:givecr(playerid, params[])

					   {
 				if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,

0xFFFFFFFF, "You are not driving a vehicle.");
				AddVehicleComponent(GetPlayerVehicleID(playerid),1079);
    			SendClientMessage(playerid, 0xFFFFFFFF, "You have added Cutter Rims to your vehicle.");
                return 1;
                }
Reply
#2

Here's it
pawn Код:
CMD:givecr(playerid,params[])
{
   if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000, "You need to login as RCON admin to use this command.");
   if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000, "You are not driving a vehicle.");
   AddVehicleComponent(GetPlayerVehicleID(playerid),1079);
   SendClientMessage(playerid, 0xFFFFFFFF, "You have added cutter rims to your vehicle.");
   return 1;
}

CMD:givegr(playerid,params[])
{
   if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000, "You need to login as RCON admin to use this command.");
   if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000, "You are not driving a vehicle.");
   AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
   SendClientMessage(playerid, 0xFFFFFFFF, "You have added gold rims to your vehicle.");
   return 1;
}
Made it as RCON command.

Edited!
Reply
#3

But man , In my script that's defferent , to make only admin's can do that of only admin's can do :

if (PlayerInfo[playerid][pAdmin] >= 4) {
Somethang like that, SO How can I put that inside the cmd:givegr and cmd:givecr
Код:
CMD:givegr(playerid, params[])
                {
 				if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,

0xFFFFFFFF, "You are not driving a vehicle.");
				AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
  			    SendClientMessage(playerid, 0xFFFFFFFF, "You have added Gold Rims to your vehicle.");
                return 1;
                }

CMD:givecr(playerid, params[])

					   {
 				if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,

0xFFFFFFFF, "You are not driving a vehicle.");
				AddVehicleComponent(GetPlayerVehicleID(playerid),1079);
    			SendClientMessage(playerid, 0xFFFFFFFF, "You have added Cutter Rims to your vehicle.");
                return 1;
                }
You can put that what I gave you inside the cmd's both ?
Reply
#4

pawn Код:
CMD:givegr(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,0xFFFFFFFF, "You are not driving a vehicle.");
        AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
        SendClientMessage(playerid, 0xFFFFFFFF, "You have added Gold Rims to your vehicle.");
    }
    else
    {
        SendClientMessage(playerid,0xFFFFFFFF, "You are not Administrator.");
    }
    return 1;
}

CMD:givecr(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 4)
    {
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,0xFFFFFFFF, "You are not driving a vehicle.");
        AddVehicleComponent(GetPlayerVehicleID(playerid),1079);
        SendClientMessage(playerid, 0xFFFFFFFF, "You have added Cutter Rims to your vehicle.");
    }
    else
    {
        SendClientMessage(playerid,0xFFFFFFFF, "You are not Administrator.");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)