[Project:Ultimate] I need to make this into an admin cmd
#1

Hello, I need to turn this code right here into an admin cmd.
Like when you login to /rcon login password, you are allowed to use it.
If you're not logged in, you get an error message.
Thanks!

pawn Код:
COMMAND:veh(playerid, params[])
        {
            new vehicleid, color1, color2;
            if(!sscanf(params, "iii", vehicleid, color1, color2))
            {
        new vin;
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        CreateVehicle(vehicleid, x, y, z, 0.0, color1, color2, -1);
        PutPlayerInVehicle(playerid, vin, 0);
            }else{
            SCM(playerid, COLOR_RED, "ERROR: This command requires: /veh [vehicleid][color1][color2]");
            }

               
         return 1;
        }
Reply
#2

pawn Код:
COMMAND:veh(playerid, params[])
{
           if(IsPlayerAdmin(playerid))
           {
            new vehicleid, color1, color2;
            if(!sscanf(params, "iii", vehicleid, color1, color2))
            {
             new vin;
             new Float:x, Float:y, Float:z;
             GetPlayerPos(playerid, x, y, z);
             CreateVehicle(vehicleid, x, y, z, 0.0, color1, color2, -1);
             PutPlayerInVehicle(playerid, vin, 0);
            }
            else
            {
            SCM(playerid, COLOR_RED, "ERROR: This command requires: /veh [vehicleid][color1][color2]");
            }
           }
           else
           {
           SCM(playerid, COLOR_RED, "ERROR: You are not Rcon Administrator");
           }
           return 1;
}
Reply
#3

Thank you!
Reply
#4

You Welcome buddy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)