Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:set(playerid, params[])
- {
- new id, item[25], value, str1[256], name[25], name2[25], admwarn[100];
- if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi prima data.");
- if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
- if(PlayerInfo[playerid][pBlocked] == 1)return SCM(playerid, COLOR_RED, "Your account is blocked");
- if(sscanf(params, "us[10]i", id, item, value))
- {
- SCM(playerid, COLOR_FADE2, "Syntax: /set <playerid> <item> <value>");
- SCM(playerid, COLOR_FADE2, "Avabile items: Skin, Group, Rank, Money, BankMoney, PP, Premium, Level, Hours, FP, Age, Team,");
- SCM(playerid, COLOR_FADE2, "RP, RobPoints, VIP, Health, Armor, VW, Int, Materials");
- }
- GetPlayerName(playerid, name, 25);
- GetPlayerName(id, name2, 25);
- format(admwarn, sizeof(admwarn), "%s[user: %d]'s %s was set to %d (( Admin %s[admin: %d] ))", name2, PlayerInfo[id][pSQLID], item, value, name, PlayerInfo[playerid][pSQLID]);
- if(strfind(item, "Skin", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pModel] = value;
- PlayerTextDrawSetPreviewModel(id, SkinPreview[id], PlayerInfo[id][pModel]);
- PlayerTextDrawShow(id, SkinPreview[id]);
- mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Model`='%d' WHERE `name`='%s'", value, name2);
- mysql_tquery(SQL,str1,"","");
- SetPlayerSkin(id, value);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item , "Group", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pMember] = value;
- mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Member`='%d' WHERE `name`='%s'", value, name2);
- mysql_tquery(SQL,str1,"","");
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Rank", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly);
- if(value < 0 || value > 6)return SCM(playerid, COLOR_FADE2, "Maxim rank is 6");
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pRank] = value;
- mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Rank`='%d' WHERE `name`='%s'", value, name2);
- mysql_tquery(SQL,str1,"","");
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Money", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- ResetPlayerCash(id);
- GivePlayerCash(id, value);
- PlayerInfo[id][pCash] = value;
- Update(id, pCashx);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "BankMoney", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pAccount] = value;
- Update(id, pBank);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "PP", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pPremiumPoints] = value;
- Update(id, pPremiumPointsx);
- PlayerInfo[id][pTotalPP] += value;
- Update(id, pTotalPPx);
- if(PlayerInfo[id][pTotalPP] >= 200 && PlayerInfo[id][pVIP] == 0)
- {
- SCM(id, COLOR_ORANGE, "In contul tau s-au acumulat un total de 200 PP iar acum esti un VIP User.");
- PlayerInfo[id][pVIP] = 1;
- Update(id, pVIPx);
- }
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Premium", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pPremiumAccount] = value;
- Update(id, pPremiumAccountx);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Level", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 6)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pLevel] = value;
- Update(id, pLevelx);
- SetPlayerScore(id, value);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Hours", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 6)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pConnectTime] = value;
- Update(id, pConnectTimex);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "FP", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pFpunish] = value;
- Update(id, pFpunishx);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Age", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pAge] = value;
- mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Age`='%d' WHERE `name`='%s'", value, name2);
- mysql_tquery(SQL,str1,"","");
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Mats", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pMats] = value;
- mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Mats`='%d' WHERE `name`='%s'", value, name2);
- mysql_tquery(SQL,str1,"","");
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Team", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pTeam] = value;
- mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Team`='%d' WHERE `name`='%s'", value, name2);
- mysql_tquery(SQL,str1,"","");
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "RP", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pExp] = value;
- Update(id, pRP);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "RobPoints", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pRob] = value;
- Update(id, pRobx);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "VIP", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- PlayerInfo[id][pVIP] = value;
- Update(id, pVIPx);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Health", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- SetPlayerHealthEx(id, value);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Armor", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- SetPlayerArmourEx(id, value);
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "VW", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- SetPlayerVirtualWorld(id, value);
- }
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- else if(strfind(item, "Int", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
- if(IsPlayerConnected(id))
- {
- SetPlayerInterior(id,value);
- PlayerInfo[id][pInt] = value;
- }
- if(!isnull(item))
- {
- ABroadCast(COLOR_ORANGE, admwarn, 1);
- }
- else
- {
- SCM(playerid, -1, "This player is not online.");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement