help with warn and kill command
#1

Hey Guys this time im talk series i realy need help or i get killed please here is too commands it work but lets take warn for example


when i do
/warn 0 Drive-By

its say to me unknow command but if i do 3 words only like /warn 0 ddd its work if you do more than 3 then unknown command

and in kill command when i use it i i do

/kill 0 you lag please rejoin

its not work why help me !!






Код:
dcmd_akill(playerid, params[])
{
	new
	    player1,
		pID,
		Reason,
		name[MAX_PLAYER_NAME],
		string2[256],
		string[256];
    if(Player[playerid][admin] < 4){
    	return SendClientMessage(playerid,COLOR_RED,"You Dont Have Right To Use This Command");
        }
    if(sscanf(params,"us",pID,Reason)){
        return SendClientMessage(playerid,COLOR_RED,"USAGE: /akill [playerid] [reason]");
        }
    if(!IsPlayerConnected(pID)) {
    	return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
     	}
	if(Player[player1][admin]){
		return SendClientMessage(playerid,COLOR_RED,"You can`t KILL yourself");
		}
    if(Player[playerid][admin] < Player[pID][admin]){
    	return SendClientMessage(playerid,COLOR_RED,"You can`t KILL a high ranked admin");
     	}
	GetPlayerName(pID,name,sizeof(name));
	format(string,sizeof(string),"**(ADMIN KILL)** %s(%d) %s",name,pID,Reason);
	format(string2,sizeof(string2),"You Have Been KILLED By Admin For Reason: %s",Reason);
	SendClientMessageToAll(COLOR_RED, string);
	SendClientMessage(pID, COLOR_RED, string2);
	SetPlayerHealth(playerid, 0.0);
	return 1;
}
Код:
dcmd_warn(playerid, params[])
{
	new warnID; new Reason; new player1;
 	if(Player[playerid][admin] < 1) return SendClientMessage(playerid,COLOR_RED,"You Dont Have Right To Use This Command");
  	if(sscanf(params,"us",warnID, Reason))return SendClientMessage(playerid, COLOR_RED, "/warn [playerid] [reason]");
  	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
  	if(Player[player1][admin]) return SendClientMessage(playerid,COLOR_RED,"You can`t WARN yourself");
    if(Player[playerid][admin] < Player[playerid][admin]) return SendClientMessage(playerid,COLOR_RED,"You can`t WARN a high ranked admin");
   	else    {
 	new wString[256], wString2[256], wString3[256], Name[MAX_PLAYER_NAME];
  	SetPVarInt(warnID, "PlayerWarnings", GetPVarInt(playerid, "PlayerWarnings")+1);
  	if(GetPVarInt(playerid, "PlayerWarnings")>=1)
   	GetPlayerName(playerid, Name,sizeof(Reason));
    format(wString, sizeof(wString), "**(ADMIN WARN)*** %s(%d) %s Read /Rules",Name, warnID, Reason);
    format(wString2, sizeof(wString2), "%s(%d) (Has Been Forced To Read Rules)",Name, warnID);
    format(wString3, sizeof(wString3), "You Have Been WARNED By Admin For: %s",Reason);
    SendClientMessageToAll(COLOR_RED, wString);
    SendClientMessageToAll(COLOR_RED, wString2);
    SendClientMessage(warnID, COLOR_RED, wString3);
    if(GetPVarInt(playerid, "PlayerWarnings")>=3)Kick(warnID);	}
    return 1;
}
Reply
#2

The warn command.
pawn Код:
dcmd_warn(playerid, params[])
{
    new
        warnID,
        Reason[128];
       
    if(Player[playerid][admin] < 1)
        return SendClientMessage(playerid,COLOR_RED,"You Dont Have Right To Use This Command");
    if(sscanf(params,"ds",warnID, Reason))
        return SendClientMessage(playerid, COLOR_RED, "/warn [playerid] [reason]");
    if(!IsPlayerConnected(playerid))
        return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
    if(warnID == playerid)
        return SendClientMessage(playerid,COLOR_RED,"You can`t WARN yourself");
    if(Player[playerid][admin] < Player[warnID][admin])
        return SendClientMessage(playerid,COLOR_RED,"You can`t WARN a high ranked admin");
       
    new
        wString[128],
        Name[24];
       
    SetPVarInt(warnID, "PlayerWarnings", GetPVarInt(playerid, "PlayerWarnings")+1);
    GetPlayerName(playerid,Name,24);
    format(wString, 128, "**(ADMIN WARN)*** %s(%d) %s Read /Rules",Name, warnID, Reason);
    SendClientMessageToAll(COLOR_RED, wString);
    format(wString, 128, "%s(%d) (Has Been Forced To Read Rules)",Name, warnID);
    SendClientMessageToAll(COLOR_RED, wString);
    format(wString, 128, "You Have Been WARNED By Admin For: %s",Reason);
    SendClientMessage(warnID, COLOR_RED, wString);
   
    if(GetPVarInt(playerid, "PlayerWarnings")>=3)
        Kick(warnID);
       
    return 1;
}
The akill command.
pawn Код:
dcmd_akill(playerid, params[])
{
    new
        pID,
        Reason;
       
    if(Player[playerid][admin] < 4)
        return SendClientMessage(playerid,COLOR_RED,"You Dont Have Right To Use This Command");
    if(sscanf(params,"ds",pID,Reason))
        return SendClientMessage(playerid,COLOR_RED,"USAGE: /akill [playerid] [reason]");
    if(!IsPlayerConnected(pID))
        return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
    if(pID == playerid)
        return SendClientMessage(playerid,COLOR_RED,"You can`t KILL yourself");
    if(Player[playerid][admin] < Player[pID][admin])
        return SendClientMessage(playerid,COLOR_RED,"You can`t KILL a high ranked admin");
       
    new
        name[24],
        string[128];
       
    GetPlayerName(pID,name,24);
    format(string,128,"**(ADMIN KILL)** %s(%d) %s",name,pID,Reason);
    SendClientMessageToAll(COLOR_RED, string);
    format(string,128,"You Have Been KILLED By Admin For Reason: %s",Reason);
    SendClientMessage(pID, COLOR_RED, string);
    SetPlayerHealth(playerid, 0.0);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)