SA-MP Forums Archive
Help with Dcmd[DINI] - 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 with Dcmd[DINI] (/showthread.php?tid=277942)



Help with Dcmd[DINI] - ServerScripter - 20.08.2011

hi , i want to add the command /mute and /slap in my FS like Dcmd[DINI]

Ex of Dcmd command:
Код:
dcmd_kick(playerid,params[])
{
	new id,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
	new tmp[256], Index, str[49];
	tmp = strtok(params,Index), id = strval(tmp);
	GetPlayerName(id,on,sizeof(on));
	GetPlayerName(playerid,n,sizeof(n));
	if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,ORANGE,"You need to be level 3 to use this command!");
	if(!strlen(params)) return SendClientMessage(playerid,GREY,"USAGE: /kick <ID> ");
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid,GREY,"Invalid ID");
	format(str,sizeof(str),"%s has kicked %s",n,on);
	SendClientMessageToAll(LIGHTBLUE,str);
	Kick(id);
	return 1;
}
Please help me to make Slap and Mute Commands...


Re: Help with Dcmd[DINI] - =WoR=G4M3Ov3r - 20.08.2011

pawn Код:
dcmd_mute(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        new string[128], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_SYN, "[Syntax:]{FFFFFF}  /mute [playerid]");

        if(IsPlayerConnected(giveplayerid))
        {
            if(giveplayerid == playerid)
            {
                SendClientMessageEx(playerid, COLOR_GRAD2, "You can not use this command on yourself!");
                return 1;
            }

            if(PlayerInfo[giveplayerid][pMuted] == 0)
            {
                if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
                {
                    format(string, sizeof(string), "%s just tried to /mute you.",GetPlayerNameEx(playerid));
                    SendClientMessageEx(giveplayerid, COLOR_YELLOW, string);
                    SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
                    return 1;
                }
                PlayerInfo[giveplayerid][pMuted] = 1;
                format(string, sizeof(string), "AdmCmd: %s was silenced by %s.",GetPlayerNameEx(giveplayerid),GetPlayerNameEx(playerid));
                ABroadCast(COLOR_LIGHTRED,string,2);
            }
            else
            {
                PlayerInfo[giveplayerid][pMuted] = 0;
                format(string, sizeof(string), "AdmCmd: %s was unsilenced by %s.",GetPlayerNameEx(giveplayerid),GetPlayerNameEx(playerid));
                ABroadCast(COLOR_LIGHTRED,string,2);
            }
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}
pawn Код:
dcmd_slap(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >=2)
    {
        new string[128], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_SYN, "[Syntax:]{FFFFFF}  /slap [playerid]");

        new Float:shealth;
        new Float:slx, Float:sly, Float:slz;

        if(IsPlayerConnected(giveplayerid))
        {

            GetPlayerHealth(giveplayerid, shealth);
            SetPlayerHealth(giveplayerid, shealth-5);
            GetPlayerPos(giveplayerid, slx, sly, slz);
            SetPlayerPos(giveplayerid, slx, sly, slz+5);
            PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
            format(string, sizeof(string), "AdmCmd: %s was slapped by %s",GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
            ABroadCast(COLOR_LIGHTRED,string,2);

        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}



Re: Help with Dcmd[DINI] - Lorenc_ - 20.08.2011

EDIT LATE


Re: Help with Dcmd[DINI] - =WoR=G4M3Ov3r - 20.08.2011

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
EDIT LATE
Lol :P

@ServerScripter Tell me if it works, If not, Post the Errors


Re: Help with Dcmd[DINI] - ServerScripter - 20.08.2011

Thank you a lot BATAD you're amazing !! and also Lorenc_ you late xD

Thank you for Helping Me Guys


Re: Help with Dcmd[DINI] - ServerScripter - 20.08.2011

i tested Mute CMD there are 1 Warning:
Код:
C:\DOCUME~1\mrich\Bureau\tyr\ZOMBIE~1\FILTER~1\admin.pwn(287) : warning 203: symbol is never used: "dcmd_mute"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
and it make whene i go to server "Unknow Command"


Re: Help with Dcmd[DINI] - =WoR=G4M3Ov3r - 20.08.2011

Quote:
Originally Posted by ServerScripter
Посмотреть сообщение
i tested Mute CMD there are 1 Warning:
Код:
C:\DOCUME~1\mrich\Bureau\tyr\ZOMBIE~1\FILTER~1\admin.pwn(287) : warning 203: symbol is never used: "dcmd_mute"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
and it make whene i go to server "Unknow Command"
Mmm, Does /slap work ?, And i advise you to add it in your GM, and not in a Filterscript