Jump to content

Cerere comanda '/set'


.CraZzY.
 Share

Recommended Posts

 

CMD:set(playerid, params[])
{
new id, item[25], value, str1[1000], 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] < 5)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");
}
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;
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);
       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, "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;
}
Link to comment
Share on other sites

CMD:set(playerid, params[])
{
new id, item[25], value, str1[1000], 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] < 5)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");
}
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;
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);
       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, "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;
}

Multumesc frumos, insa am gasit. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.