Jump to content

Question

Posted

Salutare , am avut probleme cu Vip warn , acuma vip warn merge dar...acuma am probleme cu admin warn :| am setat...la fel ca la vip si tot nu merge ... defapt merge da doar mie sami setez...sa functioneze corect cand setez la altcineva doar scrie , la fel ca in cererea trecuta doar acuma  e la admin...

//==============================================================================
CMD:setadminwarn(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new string[128], userid;
        //----------------------------------------------------------------------
        if(sscanf(params, "ud", giveplayerid1, amount2)) return
		SendClientMessage(playerid, orange, "Usage : /SetAdminWarn [Playerid] [AWarns]") &&
		SendClientMessage(playerid, LIGHTBLUE2, "Function: Will set the Admin Warns of a specified player!");
		//----------------------------------------------------------------------
        else if(giveplayerid1 == INVALID_PLAYER_ID) return
		SendClientMessage(playerid, red, "ERROR: Player not connected!");
		//----------------------------------------------------------------------
        else
        {
            SendCommandToAdmins(playerid, "SetAWarns");
            format(string, 128, "|- RCON \"%s\" has gived you +1 WARN to Admin", PlayerName2(playerid));
            SendClientMessage(giveplayerid1, blue, string);
			format(string, 128, "You have succesfully setted %s AWarns to %d!", PlayerName2(giveplayerid1), amount2);
            SendClientMessage(playerid, 0x00BBF6AA, string);
            format(string, 128, "*** RCON %s has Setted %s the ammount of AWarns to %d!", PlayerName2(playerid), PlayerName2(giveplayerid1), amount2);
			SaveIn("AdminLog", string);
            ASts[giveplayerid1][AWarns] = amount2;
		}
    	if(ASts[playerid][AWarns] < 3)
		{
			new AVW[20];
			userid = BUD::GetNameUID(PlayerName2(giveplayerid1));
			format(AVW, 20, "%d/%d", ASts[giveplayerid1][AWarns], AccInfo[giveplayerid1][pVWarns]);
			BUD::SetStringEntry(userid, "AdmVipWarns", AVW, 20);
		}
  		else if(ASts[playerid][AWarns] >= 3)
		{
			AccInfo[giveplayerid1][Level] = 0;
			userid = BUD::GetNameUID(PlayerName2(giveplayerid1));
			BUD::SetIntEntry(userid, "Admin", 0);
    		BUD::SetIntEntry(userid, "AdmWarns", 0);
		}
		return 1;
    }
	else return SendClientMessage(playerid, red, "ERROR: Only RCON Admins can use that command!");
}
asta e pentru admin si asta pentru vip
//==============================================================================
CMD:setpwarn(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new string[128], userid;
        //----------------------------------------------------------------------
        if(sscanf(params, "ud", giveplayerid1, amount2)) return
        SendClientMessage(playerid, orange, "Usage : /setpVWarns [playerid] [pVWarns]") &&
        SendClientMessage(playerid, LIGHTBLUE2, "Function: Will set the Vip Warns of a specified player!");
        //----------------------------------------------------------------------
        else if(giveplayerid1 == INVALID_PLAYER_ID) return
        SendClientMessage(playerid, red, "ERROR: Player not connected!");
        //----------------------------------------------------------------------
        else
        {
            SendCommandToAdmins(playerid, "SetpVWarns");
            format(string, 128, "|- RCON \"%s\" has gived you +1 Warn to VIP", PlayerName2(playerid));
            SendClientMessage(giveplayerid1, blue, string);
            format(string, 128, "You have succesfully setted %s pVWarns to %d!", PlayerName2(giveplayerid1), amount2);
            SendClientMessage(playerid, 0x00BBF6AA, string);
            format(string, 128, "*** RCON %s has Setted %s the ammount of pVWarns to %d!", PlayerName2(playerid), PlayerName2(giveplayerid1), amount2);
            SaveIn("AdminLog", string);
            AccInfo[giveplayerid1][pVWarns] = amount2;
        }
  		if(AccInfo[giveplayerid1][pVWarns] < 3)
        {
            new AVW2[20];
            userid = BUD::GetNameUID(PlayerName2(giveplayerid1));
            format(AVW2, 20, "%d/%d", ASts[giveplayerid1][AWarns], AccInfo[giveplayerid1][pVWarns]);
            BUD::SetStringEntry(userid, "AdmVipWarns", AVW2, 20);
        }
        else if(AccInfo[giveplayerid1][pVWarns] >= 3)
        {
            AccInfo[giveplayerid1][pVip] = 0;
            userid = BUD::GetNameUID(PlayerName2(giveplayerid1));
            BUD::SetIntEntry(userid, "Vip", 0);
    		BUD::SetIntEntry(userid, "VipWarns", 0);
        }
        return 1;
    }
    else return SendClientMessage(playerid, red, "ERROR: Only RCON Admins can use that command!");
}

la vip merge merfect la admin nu:|

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

4 answers to this question

Recommended Posts

Posted

Tu acolo alegeai pentru playerid, dar trebuia giveplayerid1 care e tinta intr-un fel.

CMD:setadminwarn(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new string[128], userid;
        //----------------------------------------------------------------------
        if(sscanf(params, "ud", giveplayerid1, amount2)) return
        SendClientMessage(playerid, orange, "Usage : /SetAdminWarn [Playerid] [AWarns]") &&
        SendClientMessage(playerid, LIGHTBLUE2, "Function: Will set the Admin Warns of a specified player!");
        //----------------------------------------------------------------------
        else if(giveplayerid1 == INVALID_PLAYER_ID) return
        SendClientMessage(playerid, red, "ERROR: Player not connected!");
        //----------------------------------------------------------------------
        else
        {
            SendCommandToAdmins(playerid, "SetAWarns");
            format(string, 128, "|- RCON \"%s\" has gived you +1 WARN to Admin", PlayerName2(playerid));
            SendClientMessage(giveplayerid1, blue, string);
            format(string, 128, "You have succesfully setted %s AWarns to %d!", PlayerName2(giveplayerid1), amount2);
            SendClientMessage(playerid, 0x00BBF6AA, string);
            format(string, 128, "*** RCON %s has Setted %s the ammount of AWarns to %d!", PlayerName2(playerid), PlayerName2(giveplayerid1), amount2);
            SaveIn("AdminLog", string);
            ASts[giveplayerid1][AWarns] = amount2;
        }
    	if(ASts[giveplayerid1][AWarns] < 3)
        {
            new AVW[20];
            userid = BUD::GetNameUID(PlayerName2(giveplayerid1));
            format(AVW, 20, "%d/%d", ASts[giveplayerid1][AWarns], AccInfo[giveplayerid1][pVWarns]);
            BUD::SetStringEntry(userid, "AdmVipWarns", AVW, 20);
        }
  		else if(ASts[giveplayerid1][AWarns] >= 3)
        {
            AccInfo[giveplayerid1][Level] = 0;
            userid = BUD::GetNameUID(PlayerName2(giveplayerid1));
            BUD::SetIntEntry(userid, "Admin", 0);
    		BUD::SetIntEntry(userid, "AdmWarns", 0);
        }
        return 1;
    }
    else return SendClientMessage(playerid, red, "ERROR: Only RCON Admins can use that command!");
}

35012l1.png.aee1a3398b9bd9f8eec50574d2cd

Posted

pai este deja giveplayerid1 :| eu nu vad unde ai modificat...sincer

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Posted

a ok mersi :D acuma am vazut si yo :)) trebuie sami pun ochelari de sudor sa vad mai clar

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.