SA-MP Forums Archive
help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help! (/showthread.php?tid=301619)



help! - ThamburaaN - 04.12.2011

if(strcmp("/kill",cmd,true) == 0)

i want it to set to only for level 2+ admins. but when i set isplayeradmin its make to login as rcon to use it.


Re: help! - bartje01 - 04.12.2011

You have to make an admin script..


Re: help! - ThamburaaN - 04.12.2011

i already have lux admin as admin script


Re: help! - bartje01 - 04.12.2011

Please show me a command from lux admin


Re: help! - ThamburaaN - 04.12.2011

here
Quote:

dcmd_carcolour(playerid,params[])
{
if(AccInfo[playerid][Level] >= 3)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);

if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3) || !IsNumeric(tmp2)) return
SendClientMessage(playerid, red, "Usage: /carcolour [PlayerID] [Colour1] [Colour2]") &&
SendClientMessage(playerid, orange, "Function: Will change vehicle colour of specified player");

new player1 = strval(tmp), colour1, colour2, string[128];
if(!strlen(tmp2)) colour1 = random(126);
else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126);
else colour2 = strval(tmp3);

if(AccInfo[player1][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
if(IsPlayerInAnyVehicle(player1))
{
SendCommandToAdmins(playerid,"CarColour");
format(string, sizeof(string), " You have Changed the colour of \"%s's\" %s to '%d,%d'", pName(player1), VehicleNames[GetVehicleModel(GetPlayerVehicleID(player1))-400], colour1, colour2);
SendClientMessage(playerid,BlueMsg,string);
if(player1 != playerid)
{
format(string,sizeof(string)," Administrator \"%s\" has changed the Colour of your %s to '%d,%d''", pName(playerid), VehicleNames[GetVehicleModel(GetPlayerVehicleID(player1))-400], colour1, colour2 );
SendClientMessage(player1,blue,string);
}
return ChangeVehicleColor(GetPlayerVehicleID(player1), colour1, colour2);
}
else return SendClientMessage(playerid,red,"ERROR: Player is not in a vehicle");
}
else return ErrorMessages(playerid, 2);
}
else return ErrorMessages(playerid, 1);
}




Re: help! - bartje01 - 04.12.2011

pawn Код:
dcmd_kill(playerid,params[])
{
if(AccInfo[playerid][Level] < 2) return SendClientMessage(playerid,-1,"You're not admin level 2.");
SetPlayerHealth(playerid,0);
    return 1;
}



Re: help! - ThamburaaN - 04.12.2011

yea but my cmds have to change to dcmd right?


Re: help! - bartje01 - 04.12.2011

Quote:
Originally Posted by ThamburaaN
Посмотреть сообщение
yea but my cmds have to change to dcmd right?
Yes you can't use dcmd and strcmp. You should use dcmd like I did


Re: help! - Neo Karls - 04.12.2011

Edit "pAdmin" as what you defined for admin or admin level 2
pawn Код:
if(strcmp(cmd, "/kill", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
          if (PlayerInfo[playerid][pAdmin] >= 2)
            {
                SetPlayerHealth(playerid, 0);
            }
        }
        return 1;
    }
Sorry about this^^^. I didnt read the last line "but when i set isplayeradmin its make to login as rcon to use it."


Re: help! - MP2 - 05.12.2011

Quote:
Originally Posted by bartje01
Посмотреть сообщение
you can't use dcmd and strcmp
Since when? I use strcmp just fine.