SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/09/2012, 12:47 AM   #1
Ruffian
Big Clucker
 
Join Date: Aug 2012
Posts: 164
Reputation: 0
Default Help for 5 commands,please [+REP]

These commands are designed for rcon admin. I would like to remove the rcon admin and remain only Level 4 Admin.

Code:
	if(strcmp(cmd, "/setkill", true) == 0) //Hm need me this commands if you can give me
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setkill [Playerid/PartOfName] [kills]");
				return 1;
			}
			new playa;
			new kills1;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			kills1 = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] == 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						PlayerInfo[playa][pKills] = kills1;
						SetPlayerScore(playa, PlayerInfo[playa][pKills]);
					}
				}
			}
		}
		return 1;
	}
Code:
	if(strcmp(cmd, "/givekill", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givekill [Playerid/PartOfName] [kills]");
				return 1;
			}
			new playa;
			new kills1;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			kills1 = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] == 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						PlayerInfo[playa][pKills] += kills1;
						SetPlayerScore(playa, PlayerInfo[playa][pKills]);
					}
				}
			}
		}
		return 1;
	}
Code:
	if(strcmp(cmd, "/givekillall", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givekillall [kills]");
				return 1;
			}
			new kills1;
			tmp = strtok(cmdtext, idx);
			kills1 = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] == 4)
			{
	   			for(new i = 0; i < MAX_PLAYERS; i++)
				{
					if(IsPlayerConnected(i))
					{
						PlayerInfo[i][pKills] += kills1;
						SetPlayerScore(i, PlayerInfo[i][pKills]);
						return 1;
					}
				}
			}
		}
		return 1;
	}
Code:
	if(strcmp(cmd, "/givemoney", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, ": /givemoney [Playerid/PartOfName] [ ]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						GivePlayerCash(playa, money);
					}
				}
			}
		}
		return 1;
	}
Code:
	if(strcmp(cmd, "/setmoney", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, ": /setmoney [Playerid/PartOfName] [ ]");
				return 1;
			}
			new playa;
			new money;
			new plname[MAX_PLAYER_NAME];
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			GetPlayerName(playa, plname, sizeof(plname));
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						SetPlayerCash(playa, money);
						format(string, sizeof(string), "  %s's   $%d !", plname, money);
				        SendClientMessage(playerid, COLOR_GREY, string);
					}
				}
			}
		}
		return 1;
	}
Ruffian is offline   Reply With Quote
Old 04/09/2012, 03:58 AM   #2
Harmon
Banned
 
Join Date: Sep 2012
Location: New York
Posts: 41
Reputation: 26
Default Re: Help for 5 commands,please [+REP]

if (PlayerInfo[playerid][pAdmin] >= 4)

Seems like they are for Admin Level 4... Maybe this code will help with /givemoney

Code:
if(strcmp(cmd, "/givemoney", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid/PartOfName] [money]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid/PartOfName] [money]");
				return 1;
			}
			money = strvalEx(tmp);
			if(PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
			            GetPlayerName(playa, giveplayer, sizeof(giveplayer));
			            PlayerInfo[playa][pCash] = PlayerInfo[playa][pCash]+money;
						GivePlayerMoney(playa,money);
						format(string, sizeof(string), "   You have given %s $%d !", giveplayer,money);
						SendClientMessage(playerid, COLOR_GREY, string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
			}
		}
		return 1;
	}
Harmon is offline   Reply With Quote
Old 04/09/2012, 01:54 PM   #3
Ruffian
Big Clucker
 
Join Date: Aug 2012
Posts: 164
Reputation: 0
Default Re: Help for 5 commands,please [+REP]

Don't work.Help please?
Ruffian is offline   Reply With Quote
Old 04/09/2012, 06:09 PM   #4
Ruffian
Big Clucker
 
Join Date: Aug 2012
Posts: 164
Reputation: 0
Default Re: Help for 5 commands,please [+REP]

HELP?
Ruffian is offline   Reply With Quote
Old 04/09/2012, 06:24 PM   #5
MarkoN
Big Clucker
 
MarkoN's Avatar
 
Join Date: May 2012
Posts: 181
Reputation: 24
Default Re: Help for 5 commands,please [+REP]

how do we know what do you use as an admin system ?
find something like new pInfo[playerid][Admin] or PlayerInfo[playerid][Admin], etc...

EDIT : just saw that. they are for level 4 admins and above if(PlayerInfo[playerid][pAdmin] >= 4)

Last edited by MarkoN; 04/09/2012 at 07:18 PM.
MarkoN is offline   Reply With Quote
Old 04/09/2012, 07:56 PM   #6
XtremeR
Gangsta
 
XtremeR's Avatar
 
Join Date: Aug 2012
Location: Australia
Posts: 906
Reputation: 547
Default Re: Help for 5 commands,please [+REP]

if ur using ladmin pm me i can help
__________________
My works
XtremeR is offline   Reply With Quote
Old 04/09/2012, 07:56 PM   #7
Ruffian
Big Clucker
 
Join Date: Aug 2012
Posts: 164
Reputation: 0
Default Re: Help for 5 commands,please [+REP]

I have my admin system, but are something like these commands tochno.Sled log in with rcon stava.Mozhe everything you do me the commands are the same, but have you made, not there.
Ruffian is offline   Reply With Quote
Old 04/09/2012, 08:58 PM   #8
Ruffian
Big Clucker
 
Join Date: Aug 2012
Posts: 164
Reputation: 0
Default Re: Help for 5 commands,please [+REP]

Please help
Ruffian is offline   Reply With Quote
Old 04/09/2012, 10:31 PM   #9
mamorunl
High-roller
 
mamorunl's Avatar
 
Join Date: Feb 2007
Location: Emmen/Netherlands
Posts: 4,009
Reputation: 1664
Default Re: Help for 5 commands,please [+REP]

Didn't get anything from that last message. If you use a translator at least make sure you don't have your foreign words still in them.

I am just going to take a guess here as I wasn't able to translate your message at all:
If the commands are still only for RCON admin, then there must be some statement surrounding your text. Look and see if there is a statement like if(IsPlayerAdmin(playerid)) surrounding your statements (or check elsewhere in your code).
__________________
mamorunl is offline   Reply With Quote
Old 05/09/2012, 02:29 PM   #10
Ruffian
Big Clucker
 
Join Date: Aug 2012
Posts: 164
Reputation: 0
Default Re: Help for 5 commands,please [+REP]

Explain the last. Can write commands that are level 4 Admin, but are not. Rights are level 4 Admin and allows me to use them. When you go in with rcon then let me. If anyone can help me fix it please write to me, and if you can please give me a ready-made commands otherwise.
Ruffian is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Login/Register using ZCMD SSCANF & Y_INI.( Admin commands + VIP System + VIP Commands! ) Zh3r0 Filterscripts 115 03/06/2013 06:30 AM
My Filterscript makes it so no server commands work (IE. Commands in the GM) [MM]18240[FMB] Scripting Help 16 18/07/2012 11:46 PM
Transforming zcmd's commands to regular commands nuriel8833 Help Archive 17 08/01/2011 06:41 AM
DCMD Commands not working after adding some ZCMD commands :S [L3th4l] Help Archive 4 20/01/2010 10:57 PM


All times are GMT. The time now is 03:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.