Jump to content

Question

Posted

Salutare , am un bug...sau nu stiu sigur , dar consta in chestia ca la ID 0 merge comanda perfect dar la celelalte id'uri cand dau pWarn merge ... dar cand are 3 warn-uri nu ia demote la vip :| , arata (3 Warns - Demoted) dar are acelasi nivel de VIP

CMD:setpwarn(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new string[128], issuerid, 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[issuerid][pVWarns] < 3)
		{
			new AVW2[20];
			userid = BUD::GetNameUID(PlayerName2(giveplayerid1));
			format(AVW2, 20, "%d/%d", ASts[issuerid][AWarns], AccInfo[issuerid][pVWarns]);
			BUD::SetStringEntry(userid, "AdmVipWarns", AVW2, 20);
		}
		else if(AccInfo[issuerid][pVWarns] >= 3)
		{
			AccInfo[issuerid][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!");
}

Ce sa fac :|? ca eu cred ca am facut totul ok

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

 

2 answers to this question

Recommended Posts

Posted

Incearca asa:

CMD:setpwarn(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new string[128], issuerid, 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!");
}

35012l1.png.aee1a3398b9bd9f8eec50574d2cd

Posted

Merge mersi :D

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.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.