I need help with Admin Commands
#1

ok i'm tried making admin commands and taking some of parts
from script and from SAMP Forums.

ok here is the admin command i need.

Make sure its made in ZCMD

/jail - Jailed for 3 Minutes (no <time> just /jail <id> <reason>)
/unjail - if player realize his/her punishment this should be needed
/mute - Mute for 2 Minute (/mute <id> <reason>) (Extra with OnPlayerText)
* GAMER_PS2 slaps - (/slap <id> <reason>) around a bit with a large trout.
/setcash (/setcash <id> <amount> Amount only at 10000000)
/setscore(/setscore <id> <amount> Amount only at 9999999)
/ban (That bans player with Savelog)
/unban (That unbans player)

Thats All i will post new one if needed
Reply
#2

Do you need a scripter xD I will do for Admin Privilages.
Reply
#3

Here is for the money:
Код:
	if(strcmp(cmd, "/setmoney", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /money [playerid/PartOfName] [money]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 1337)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						SafeResetPlayerMoney(playa);
						//ConsumingMoney[playa] = 1;
						SafeGivePlayerMoney(playa, money);
						GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, 256, "AdmWarning: %s has set %s money to $%d.", sendername,giveplayer,money);
						ABroadCast(COLOR_YELLOW,string,1);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
			}
		}
		return 1;
	}
Here is for Unban:
Код:
	if(strcmp(cmd,"/unbanip",true)==0)
	{
		if(PlayerInfo[playerid][pAdmin] >= 5)
		{
		    tmp = strtok(cmdtext,idx);
		    if(!strlen(tmp))
		    {
		        SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /unbanip [players ip]");
		        return 1;
   			}

			format(string,sizeof(string),"unbanip %s",tmp);
			SendRconCommand(string);
			SendRconCommand("reloadbans");
   			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, 256, "AdmWarning: %s has unbanned IP %s", sendername,tmp);
			ABroadCast(COLOR_YELLOW,string,1);
		}
		return 1;
	}
Here is for Stats:
Код:
	if(strcmp(cmd, "/setstat", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /setstat [playerid/PartOfName] [statcode] [amount]");
				SendClientMessage(playerid, COLOR_GRAD4, "|1 Level |2 SpawnHealth |3 UpgradePoints |4 Model |5 BankAccount");
				SendClientMessage(playerid, COLOR_GRAD3, "|6 PhoneNumber |7 RespectPoints |8 HouseKey |9 BizKey |10 DonateRank");
				SendClientMessage(playerid, COLOR_GRAD2, "|11 FMember |12 Det |13 Lawyer |14 Fixer |15 News |16 Jack |17 Drug");
				SendClientMessage(playerid, COLOR_GRAD2, "|18 Sex |19 Box |20 PassKey |21 VehKey1 |22 VehKey2 |23 VehKey3");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
	    	{
	    	    if(giveplayerid != INVALID_PLAYER_ID)
	    	    {
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /setstat [playerid/PartOfName] [statcode] [amount]");
						SendClientMessage(playerid, COLOR_GRAD4, "|1 Level |2 SpawnHealth |3 UpgradePoints |4 Model |5 BankAccount");
						SendClientMessage(playerid, COLOR_GRAD3, "|6 PhoneNumber |7 RespectPoints |8 HouseKey |9 BizKey |10 DonateRank");
						SendClientMessage(playerid, COLOR_GRAD2, "|11 FMember |12 Det |13 Lawyer |14 Fixer |15 News |16 Jack |17 Drug");
						SendClientMessage(playerid, COLOR_GRAD2, "|18 Sex |19 Box |20 PassKey |21 VehKey1 |22 VehKey2 |23 VehKey3");
						return 1;
					}
					new stat;
					stat = strval(tmp);
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /setstat [playerid/PartOfName] [statcode] [amount]");
						SendClientMessage(playerid, COLOR_GRAD4, "|1 Level |2 SpawnHealth |3 UpgradePoints |4 Model |5 BankAccount");
						SendClientMessage(playerid, COLOR_GRAD3, "|6 PhoneNumber |7 RespectPoints |8 HouseKey |9 BizKey |10 DonateRank");
						SendClientMessage(playerid, COLOR_GRAD2, "|11 FMember |12 Det |13 Lawyer |14 Fixer |15 News |16 Jack |17 Drug");
						SendClientMessage(playerid, COLOR_GRAD2, "|18 Sex |19 Box |20 PassKey |21 VehKey1 |22 VehKey2 |23 VehKey3");
						return 1;
					}
					new amount;
					amount = strval(tmp);
					if (PlayerInfo[playerid][pAdmin] >= 1337)
					{
						switch (stat)
						{
							case 1:
							{
								PlayerInfo[giveplayerid][pLevel] = amount;
								format(string, sizeof(string), "   The Player Was Set To Level %d", amount);
							}
							case 2:
							{
								PlayerInfo[giveplayerid][pSHealth] = amount;
								format(string, sizeof(string), "   The Player Was Set To %d Spawnhealth ", amount);
							}
							case 3:
							{
								PlayerInfo[giveplayerid][gPupgrade] = amount;
								format(string, sizeof(string), "   The Player Was Set To %d Upgrade Points", amount);
							}
							case 4:
							{
								PlayerInfo[giveplayerid][pModel] = amount;
								format(string, sizeof(string), "   The Player Was Set To Model %d", amount);
							}
							case 5:
							{
								PlayerInfo[giveplayerid][pAccount] = amount;
								format(string, sizeof(string), "   The Player Account Was Set To $%d", amount);
							}
							case 6:
							{
								PlayerInfo[giveplayerid][pPnumber] = amount;
								format(string, sizeof(string), "   The Player Phone Number Was Set To %d", amount);
							}
							case 7:
							{
								PlayerInfo[giveplayerid][pExp] = amount;
								format(string, sizeof(string), "   The Player Respect Points Were Set To %d", amount);
							}
							case 8:
							{
								PlayerInfo[giveplayerid][pPhousekey] = amount;
								format(string, sizeof(string), "   The Player House Key Was Set To %d", amount);
							}
							case 9:
							{
								PlayerInfo[giveplayerid][pPbiskey] = amount;
								format(string, sizeof(string), "   The Player Business Key Was Set To %d", amount);
							}
							case 10:
							{
								PlayerInfo[giveplayerid][pDonateRank] = amount;
								format(string, sizeof(string), "   The Player DonateRank Was Set To %d", amount);
							}
							case 11:
							{
								PlayerInfo[giveplayerid][pFMember] = amount;
								format(string, sizeof(string), "   The Player Family Member Was Set To %d", amount);
							}
							case 12:
							{
								PlayerInfo[giveplayerid][pDetSkill] = amount;
								format(string, sizeof(string), "   The Player Detective Skill Set To %d", amount);
							}
							case 13:
							{
								PlayerInfo[giveplayerid][pLawSkill] = amount;
								format(string, sizeof(string), "   The Player Lawyer Skill Set To %d", amount);
							}
							case 14:
							{
								PlayerInfo[giveplayerid][pMechSkill] = amount;
								format(string, sizeof(string), "   The Player Car Mechanic Skill Set To %d", amount);
							}
							case 15:
							{
								PlayerInfo[giveplayerid][pNewsSkill] = amount;
								format(string, sizeof(string), "   The Player News Reporter Skill Set To %d", amount);
							}
							case 16:
							{
								PlayerInfo[giveplayerid][pJackSkill] = amount;
								format(string, sizeof(string), "   The Player Car Jacker Skill Set To %d", amount);
							}
							case 17:
							{
								PlayerInfo[giveplayerid][pDrugsSkill] = amount;
								format(string, sizeof(string), "   The Player Drug Dealer Skill Set To %d", amount);
							}
							case 18:
							{
								PlayerInfo[giveplayerid][pSexSkill] = amount;
								format(string, sizeof(string), "   The Player Sex Skill Set To %d", amount);
							}
							case 19:
							{
								PlayerInfo[giveplayerid][pBoxSkill] = amount;
								format(string, sizeof(string), "   The Player Box Skill Set To %d", amount);
							}
							case 21:
							{
							    PlayerInfo[giveplayerid][pPcarkey] = amount;
							    format(string, sizeof(string), "   The Player VehKey1 Set To %d", amount);
							}
							case 22:
							{
							    PlayerInfo[giveplayerid][pPcarkey2] = amount;
							    format(string, sizeof(string), "   The Player VehKey2 Set To %d", amount);
							}
							case 23:
							{
							    PlayerInfo[giveplayerid][pPcarkey3] = amount;
							    format(string, sizeof(string), "   The Player VehKey3 Set To %d", amount);
							}
							case 77:
							{
								PlayerInfo[giveplayerid][pJob] = amount;
								format(string, sizeof(string), "   The Player Job Set To %d", amount);
							}
							case 88:
							{
								PlayerInfo[giveplayerid][pContractTime] = amount;
								format(string, sizeof(string), "   The Player Job Contract Time Set To %d", amount);
							}
							default:
							{
								format(string, sizeof(string), "   Invalid Stat Code", amount);
							}

						}
						SendClientMessage(playerid, COLOR_GRAD1, string);
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
					}
				}//not valid id
			}//not connected
		}
		return 1;
	}
Reply
#4

i really need a scripter but i need these codes
Reply
#5

Try this codes for commands, btw what GM do u have?
Reply
#6

I will do the code for you, add me on ********.
www.********.com/TheLazySloth
Reply
#7

it must be in ZCMD but i'm confuse why people dont read the description
Reply
#8

It's always like that.
Reply
#9

i use my own GM Homemade but i'm creating in filterscript so no prevent bugs
Reply
#10

Okay, did you add me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)