Jump to content
  • 0
Sign in to follow this  
Iulian2

Cerere comanda

Question

6 answers to this question

Recommended Posts

  • 0
CMD:setlevel(playerid, params[]) {
    new userID, level; if(sscanf(params, "ud",userID, level)) return SCM(playerid, -1, "/setlevel <Name/ID> <Level>");
    PlayerInfo[userID][pLevel] = level; SetPlayerScore(userID,  level);
	return true;
}

 

Edited by MiritaXD

Share this post


Link to post
Share on other sites
  • 0
On 5/12/2019 at 2:07 PM, MiritaXD said:

CMD:setlevel(playerid, params[]) {
    new userID, level; if(sscanf(params, "ud",userID, level)) return SCM(playerid, -1, "/setlevel <Name/ID> <Level>");
    PlayerInfo[userID][pLevel] = level; SetPlayerScore(userID,  level);
	return true;
}

 

Asta nu o sa-i salveze si in baza de date, deci dupa re-log, s-a dus levelu!l

Share this post


Link to post
Share on other sites
  • 0

Daca nu ma insel in gamemode BigZone este deja implementata comanda [/set] si acolo sunt mai multe variabile.

Share this post


Link to post
Share on other sites
  • 0
On 5/12/2019 at 8:38 PM, Iulian2 said:

GM BigZone

Vreau sa fac o comanda /set level si habar nu am...

Uite aici o comanda [/set] ia-ti ce iti trebuie din ea, nu e optimizata dar o poti optimiza si tu.

CMD:set(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
	if(IsPlayerConnected(playerid))
 	{
 		if(PlayerInfo[playerid][pAdmin] >= 7)
		{
			new id, item[20], amount, string[128], str[256];
			if(sscanf(params, "us[20]d", id, item, amount))
			{
				SendClientMessage(playerid, COLOR_GREY, "Syntax:{FFFFFF} /set [playerid] [item] [amount]");
				SendClientMessage(playerid, COLOR_GREY, "Items: Health, Armour, Money, BankMoney, Skin, Interior, VirtualWorld, Job, RP, TemporarSkin, RB, roll");
				SendClientMessage(playerid, COLOR_GREY, "Items: Hours, Drugs, Int, Vw, Phone, Materials, Group, Grouprank, Age, Gender, Level, RP, Premium, FP, PP");
				return 1;//
			}
			if(IsPlayerConnected(id))
			{
				if(id != INVALID_PLAYER_ID)
			    {
					if(strcmp(item,"health",true) == 0)
					{
					    if(PlayerInfo[playerid][pAdmin] >= 7)
						SetPlayerHealthEx(id, amount);
						format(string, sizeof(string), "%s[user:%d]'s health was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your health to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"armour",true) == 0)
					{
					    if(PlayerInfo[playerid][pAdmin] >= 7)
						SetPlayerArmourEx(id, amount);
						format(string, sizeof(string), "%s[user:%d]'s armour was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your armour to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"money",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						ResetPlayerCash(id);
						GivePlayerCash(id, amount);
						Update(id, pCashx);
						format(string, sizeof(string), "%s[user:%d]'s money was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your money to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"bankmoney",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						PlayerInfo[id][pAccount] = amount;
						Update(id, pBank);
						format(string, sizeof(string), "%s[user:%d]'s bank money was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your bank money to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"hours",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						PlayerInfo[id][pConnectTime] = amount;
						Update(id, pConnectTimex);
						format(string, sizeof(string), "%s[user:%d]'s playing hours was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your playing hours to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"skin",true) == 0)
					{
					    if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 0 || amount > 311) return SendClientMessage(playerid, COLOR_GREY, "Skin id must between 0 and 311.");
						PlayerInfo[id][pModel] = amount;
						mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Model`='%d' WHERE `name`='%s'", PlayerInfo[id][pModel], PlayerInfo[id][pNormalName]);
						mysql_tquery(SQL,str,"","");
						SetPlayerSkin(id, PlayerInfo[id][pModel]);
						format(string, sizeof(string), "%s[user:%d]'s skin was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your skin to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"temporarskin",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 0 || amount > 311) return SendClientMessage(playerid, COLOR_GREY, "Skin id must between 0 and 311.");
						SetPlayerSkin(id, amount);
						format(string, sizeof(string), "%s[user:%d]'s temporar skin was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your temporar skin to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"int",true) == 0)
					{
					    if(PlayerInfo[playerid][pAdmin] >= 7)
						SetPlayerInterior(id, amount);
						PlayerInfo[id][pInt] = amount;
						format(string, sizeof(string), "%s[user:%d]'s interior was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your interior to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"vw",true) == 0)
					{
					    if(PlayerInfo[playerid][pAdmin] >= 7)
						SetPlayerVirtualWorld(id, amount);
						format(string, sizeof(string), "%s[user:%d]'s virtual world was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your virtual world to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"job",true) == 0)
					{
					    if(PlayerInfo[playerid][pAdmin] >= 7)
						PlayerInfo[id][pJob] = amount;
						mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Job`='%d' WHERE `name`='%s'", PlayerInfo[id][pJob], PlayerInfo[id][pNormalName]);
						mysql_tquery(SQL,str,"","");
						format(string, sizeof(string), "%s[user:%d]'s job was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your job to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"phone",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						format(str, sizeof(str), "SELECT * FROM `users` WHERE `PhoneNr` = '%d' ORDER BY `id` ASC", amount);
						new Cache: res = mysql_query(SQL, str);
						if(cache_get_row_count() != 0)
						{
							SendClientMessage(playerid, COLOR_GREY, "That phone number is used by another player.");
							cache_delete(res);
							return 1;
						}
						else
						{
							if(amount < 1000 || amount > 9999)
							{
								SendClientMessage(playerid, COLOR_GREY, "Phone number must be between 1000 and 9999.");
								cache_delete(res);
								return 1;
							}
							PlayerInfo[id][pPhone] = 1;
							PlayerInfo[id][pPnumber] = amount;
							mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Phone`='1',`PhoneNr`='%d' WHERE `name`='%s'", PlayerInfo[id][pPnumber], PlayerInfo[id][pNormalName]);
							mysql_tquery(SQL,str,"","");
						}
						cache_delete(res);
						format(string, sizeof(string), "%s[user:%d]'s phone number was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your phone number to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"materials",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						PlayerInfo[id][pMats] = amount;
						mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Materials`='%d' WHERE `name`='%s'", PlayerInfo[id][pMats], PlayerInfo[id][pNormalName]);
						mysql_tquery(SQL,str,"","");
						format(string, sizeof(string), "%s[user:%d]'s materials was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your materials to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"rb",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						PlayerInfo[id][pRob] = amount;
						mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Rob`='%d' WHERE `name`='%s'", PlayerInfo[id][pMats], PlayerInfo[id][pNormalName]);
						mysql_tquery(SQL,str,"","");
						format(string, sizeof(string), "%s[user:%d]'s Rob Point's was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your Rob point's to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"drugs",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						PlayerInfo[id][pDrugs] = amount;
						mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Drugs`='%d' WHERE `name`='%s'", PlayerInfo[id][pMats], PlayerInfo[id][pNormalName]);
						mysql_tquery(SQL,str,"","");
						format(string, sizeof(string), "%s[user:%d]'s Drugs was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your drugs to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"group",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 0 || amount > 25) return SendClientMessage(playerid, COLOR_GREY, "Group id must be between 1 and 25.");
						PlayerInfo[id][pMember] = amount;
						if(amount > 0) PlayerInfo[id][pRank] = 1;
						else PlayerInfo[id][pRank] = 0;
						PlayerInfo[id][pModel] = 250;
						if(amount == 0)
						{
						    gTeam[id] = 3;
					    	PlayerInfo[id][pTeam] = 3;
						}
						else if(amount == 1 || amount == 2 || amount == 3 || amount == 25 || amount == 8 || amount == 16)
						{
						    gTeam[id] = 2;
					    	PlayerInfo[id][pTeam] = 2;
						}
						else if(amount == 4 || amount == 5 || amount== 6 || amount == 10 || amount == 15 || amount == 21 || amount == 23 || amount == 24)
						{
						    gTeam[id] = 5;
					    	PlayerInfo[id][pTeam] = 5;
						}
						else if(amount == 9 || amount == 14 || amount == 18 || amount == 13 || amount == 19 || amount == 20 || amount == 17 || amount == 12 || amount == 22)
						{
						    gTeam[id] = 4;
					    	PlayerInfo[id][pTeam] = 4;
						}
						else if(amount == 11)
						{
						    gTeam[id] = 11;
					    	PlayerInfo[id][pTeam] = 11;
						}
						SetPlayerSkin(id, PlayerInfo[id][pModel]);
						if(amount > 0) PlayerInfo[id][pFactionJoin] = gettime();
						else PlayerInfo[id][pFactionJoin] = 0;
						mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Team`='%d',`Member`='%d',`Rank`='%d',`Model`='%d',`FactionJoin`='%d' WHERE `name`='%s'", PlayerInfo[id][pTeam], PlayerInfo[id][pMember], PlayerInfo[id][pRank], PlayerInfo[id][pModel], PlayerInfo[id][pFactionJoin], PlayerInfo[id][pNormalName]);
						mysql_tquery(SQL,str,"","");
						format(string, sizeof(string), "%s[user:%d]'s group was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	SetPlayerToTeamColor(id);
		            	format(string, sizeof(string), "* Admin %s has set your group to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"grouprank",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						if(PlayerInfo[id][pMember] < 1) return SendClientMessage(playerid, COLOR_GREY, "This player is not in a group.");
						if(amount < 1 || amount > 7) return SendClientMessage(playerid, COLOR_GREY, "Rank must be between 1 and 7.");
						PlayerInfo[id][pRank] = amount;
						mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Rank`='%d' WHERE `name`='%s'", PlayerInfo[id][pRank], PlayerInfo[id][pNormalName]);
						mysql_tquery(SQL,str,"","");
						format(string, sizeof(string), "%s[user:%d]'s group rank was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your group rank to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"age",true) == 0)
					{
					    if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 1) return SendClientMessage(playerid, COLOR_GREY, "Age must be more than 0.");
						PlayerInfo[id][pAge] = amount;
						mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Age`='%d' WHERE `name`='%s'", PlayerInfo[id][pAge], PlayerInfo[id][pNormalName]);
						mysql_tquery(SQL,str,"","");
						format(string, sizeof(string), "%s[user:%d]'s age was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your age to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"gender",true) == 0)
					{
					    if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 1 || amount > 2) return SendClientMessage(playerid, COLOR_GREY, "Gender must be 1 (male) or 2 (female).");
						PlayerInfo[id][pSex] = amount;
						mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Sex`='%d' WHERE `name`='%s'", PlayerInfo[id][pSex], PlayerInfo[id][pNormalName]);
						mysql_tquery(SQL,str,"","");
						format(string, sizeof(string), "%s[user:%d]'s gender was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your gender to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"level",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 1) return SendClientMessage(playerid, COLOR_GREY, "Level must be more than 0.");
						PlayerInfo[id][pLevel] = amount;
						Update(id, pLevelx);
						UpdateProgressBar(id);
						SetPlayerScore(id, PlayerInfo[id][pLevel]);
						format(string, sizeof(string), "%s[user:%d]'s level was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your level to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"rp",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 1) return SendClientMessage(playerid, COLOR_GREY, "Respect points must be more than 0.");
						PlayerInfo[id][pExp] = amount;
						Update(id, pRP);
						UpdateProgressBar(id);
						format(string, sizeof(string), "%s[user:%d]'s respect points were set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your respect points to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"premium",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 0 || amount > 2) return SendClientMessage(playerid, COLOR_GREY, "Premium must be 0 (Normal), 1 (Premium) or 2 (VIP).");
						PlayerInfo[id][pPremiumAccount] = amount;
						if(amount > 0)
						{
							if(PlayerInfo[id][pCarSlots] <= 8)
							{
								PlayerInfo[id][pCarSlots] += 2;
							}
							if(PlayerInfo[id][pCarSlots] == 9)
							{
								PlayerInfo[id][pCarSlots] += 1;
							}
						}
						mysql_format(SQL, string, sizeof(string), "UPDATE users SET `Premium`='%d',`CarSlots`='%d' WHERE `name`='%s'", PlayerInfo[playerid][pPremiumAccount], PlayerInfo[id][pCarSlots], PlayerInfo[id][pNormalName]);
    					mysql_tquery(SQL,string,"","");
						format(string, sizeof(string), "%s[user:%d]'s premium was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your premium to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"fp",true) == 0)
					{
					    if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 0 || amount > 200) return SendClientMessage(playerid, COLOR_GREY, "Faction punish must be between 0 and 200.");
						PlayerInfo[id][pFpunish] = amount;
						Update(id, pFpunishx);
						format(string, sizeof(string), "%s[user:%d]'s faction punish was set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 1);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	format(string, sizeof(string), "* Admin %s has set your faction punish to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"pp",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 0) return 1;
						PlayerInfo[id][pPremiumPoints] = amount;
						Update(id, pPremiumPointsx);
						format(string, sizeof(string), "%s[user:%d]'s premium points were set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 6);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	mysql_format(SQL, string, sizeof(string), "UPDATE `users` SET TotalPP=TotalPP+%d WHERE `name` = '%s'", amount, PlayerInfo[id][pNormalName]);
    					mysql_tquery(SQL,string,"","");
    					format(string, sizeof(string), "* Admin %s has set your premium points to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
					else if(strcmp(item,"rsp",true) == 0)
					{
						if(PlayerInfo[playerid][pAdmin] >= 7)
						if(amount < 0) return 1;
						PlayerInfo[id][pRSP] = amount;
						Update(id, pRSPx);
						format(string, sizeof(string), "%s[user:%d]'s RS-Points were set to %d (( Admin %s[admin:%d] ))", PlayerInfo[id][pNormalName], PlayerInfo[id][pSQLID], amount, PlayerInfo[playerid][pNormalName], PlayerInfo[playerid][pSQLID]);
		            	ABroadCast(COLOR_ADMCOMMANDS, string, 6);
		            	Log(PlayerInfo[playerid][pSQLID], string, "set");
		            	mysql_format(SQL, string, sizeof(string), "UPDATE `users` SET RSP=RSP+%d WHERE `name` = '%s'", amount, PlayerInfo[id][pNormalName]);
    					mysql_tquery(SQL,string,"","");
    					format(string, sizeof(string), "* Admin %s has set your RS-Points to %d.", PlayerInfo[playerid][pNormalName], amount);
		            	SendClientMessage(id, COLOR_RED2, string);
					}
				}
			}
			else return SendClientMessage(playerid, COLOR_GREY, "Player not connected.");
		}
		else return 1;
 	}
 	return 1;
}

 

Share this post


Link to post
Share on other sites
  • 0
La 15.05.2019 la 22:04, mrtea a spus:

Asta nu o sa-i salveze si in baza de date, deci dupa re-log, s-a dus levelu!l

Update(userID, pLevelx); // e mare lucru sa adauge asta?(cred ca asa era functia) :))

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.