SA-MP Forums Archive
[Help]LAdmin Filterscript Problem[Dcmd_Slap] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help]LAdmin Filterscript Problem[Dcmd_Slap] (/showthread.php?tid=103088)



[Help]LAdmin Filterscript Problem[Dcmd_Slap] - Tigerbeast11 - 18.10.2009

Hi! Im using LAdmin, and I have editted it a bit, but I couldnt edit it as I wanted:

pawn Код:
dcmd_slap(playerid,params[]) {
    if(PlayerInfo[playerid][LoggedIn] == 1) {
        if(PlayerInfo[playerid][Level] >= 2) {
          new tmp[256], tmp2[256], Index;       tmp = strtok(params,Index), tmp2 = strtok(params,Index);
          if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /slap [playerid] [reason/with]");
        new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            player1 = strval(tmp);
           
            GetPlayerName(player1, playername, sizeof(playername));
            GetPlayerName(playerid, adminname, sizeof(adminname));
            CMDMessageToAdmins(playerid,"SLAP");
            new Float:Health, Float:x, Float:y, Float:z; GetPlayerHealth(player1,Health); SetPlayerHealth(player1,Health-40);
            GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+10); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);

            if(strlen(tmp2)) {
                format(string,sizeof(string),"You have been slapped by Administrator %s for %s",adminname,params[2]);   SendClientMessage(player1,red,string);
                format(string,sizeof(string),"You have slapped %s for %s ",playername,params[2]); return SendClientMessage(playerid,blue,string);
                } else {
                format(string,sizeof(string),"You have been slapped by Administrator %s ",adminname);   SendClientMessage(player1,red,string);
                format(string,sizeof(string),"You have slapped %s",playername); return SendClientMessage(playerid,blue,string); }
        } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
I did this so you were able to slap yourself... However, some admins are abusing and slapping admins that are higher than them. I dont want to demote, but how can i edit this so that you can only slap admins that are the same level as you?

Basically, i want it to check weather the player that is being slapped is a higher level than the admin... If yes, then the slap doesnt work...



Re: [Help]Admin CMD Problem[Dcmd_Slap] - Tigerbeast11 - 18.10.2009

Really sorry for bump, but please post if you know the answer...


Re: [Help]LAdmin Filterscript Problem[Dcmd_Slap] - Tigerbeast11 - 22.10.2009

Please someone answer this.

Note: The smart asses out there who think this is a bump, plz don't post here! This is not a bump as I am posting 12 hours later than my last post!


Re: [Help]LAdmin Filterscript Problem[Dcmd_Slap] - Rickyboy30 - 22.10.2009

Wow yeah, Please Use { and } in your script, and line it out 0.o


Re: [Help]LAdmin Filterscript Problem[Dcmd_Slap] - Tigerbeast11 - 22.10.2009

Quote:
Originally Posted by Rickyboy30
Wow yeah, Please Use { and } in your script, and line it out 0.o
Dude, this isn't my script... I took it from LAdmin! Anyways, could you write a more helpful remark and try to answer my question!