Need Some Commands, Please
#1

Hey Guys,


Can anyone give me a working set of, Mute , Unmute , Freeze , and Unfreeze commands. Strcmp format of corse. And please include everything needed for them. News , defines , etc.


Please and thanks, Im not good enough scripter to code myself, so please help.


Rick

~Edit~: Also if someone can get a working RAC(Respawn All Cars) command as well it would really be helpfull. Alot of cars glitch when the server starts, i dont know why.....
Reply
#2

I can only give you /freeze,/unfreeze (without adminmod,if you want tell me)

Код:
	if(strcmp(cmd, "/freeze", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /freeze [playerid/PartOfName]");
				return 1;
			}
			new playa;
			playa = ReturnUser(tmp);
			  if(IsPlayerConnected(playa))
			  {
			    if(playa != INVALID_PLAYER_ID)
			    {
				    GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						TogglePlayerControllable(playa, 0);
						format(string, sizeof(string), "%s Freezes %s",sendername, giveplayer);
						printf("%s",string);
					}
				}
			}
		return 1;
	}
Unfreeze
Код:
	if(strcmp(cmd, "/unfreeze", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /unfreeze [playerid]");
				return 1;
			}
			new playa;
			playa = ReturnUser(tmp);
			  if(IsPlayerConnected(playa))
			  {
			    if(playa != INVALID_PLAYER_ID)
			    {
			  	  GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						TogglePlayerControllable(playa, 1);
						format(string, sizeof(string), "%s unfreezes %s",sendername, giveplayer);
						printf("%s",string);

					}
				}
			}
		return 1;
	}
Reply
#3

dcmd > strcmp.
Reply
#4

Thank you.

One problem. I asked that you put all the crap needed for it. If you put that in a script you would get these errors if you didnt have cmd tmp and idx defined i did:

C:\Documents and Settings\Desktop\RJDM.pwn(354) : error 017: undefined symbol "ReturnUser"
C:\Documents and Settings\Desktop\RJDM.pwn(359) : error 017: undefined symbol "giveplayer"
C:\Documents and Settings\Desktop\RJDM.pwn(359) : error 017: undefined symbol "giveplayer"

If you could give me the crap for that i would be thankfull,

Rick
Reply
#5

Can someone give me whats needed for those commands to work?


Rick
Reply
#6

Quote:
Originally Posted by Rick_Jones
Thank you.

One problem. I asked that you put all the crap needed for it. If you put that in a script you would get these errors if you didnt have cmd tmp and idx defined i did:

C:\Documents and Settings\Desktop\RJDM.pwn(354) : error 017: undefined symbol "ReturnUser"
C:\Documents and Settings\Desktop\RJDM.pwn(359) : error 017: undefined symbol "giveplayer"
C:\Documents and Settings\Desktop\RJDM.pwn(359) : error 017: undefined symbol "giveplayer"

If you could give me the crap for that i would be thankfull,

Rick
Im pretty sure the person should have told you to define them first.
and also you have to include the dini.inc.
So at the top where it says
Код:
#include <a_samp>
Type #include <dini> so it will look like this
Код:
#include <a_samp>
#include <dini>
Reply
#7

Then it gives me this new error

C:\Documents and Settings\Desktop\RJDM.pwn(349) : error 047: array sizes do not match, or destination array is too small


Rick
Reply
#8

Here is mute and unmute, it should work, although it is untested

Mute
Код:
new Muted[MAX_PLAYERS];

public OnPlayerText(playerid, text[])
{
	if(Muted[playerid]==1)
	{
		SendClientMessage(playerid, 0xAA333300, "You are muted");
		return 0;
	}
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmd, "/mute", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, 0xAA333300, "USAGE: /mute [playerid]");
			return 1;
		}
		if (!IsPlayerConnected(tmp))
		{
			new name[MAX_PLAYER_NAME], tmp2[128];
			Muted[tmp]=1;
			GetPlayerName(tmp,name,sizeof(name));
			format(tmp2,sizeof(tmp2),"Muted %s [ID:%i]",name,tmp);
			SendClientMessage(playerid, 0xAA333300, tmp2);
			return 1;
		}
	}
}

public OnPlayerDisconnect(playerid, reason)
{
	Muted[playerid]=0;
}
Unmute
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmd, "/unmute", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, 0xAA333300, "USAGE: /unmute [playerid]");
			return 1;
		}
		if (!IsPlayerConnected(tmp))
		{
			new name[MAX_PLAYER_NAME], tmp2[128];
			Muted[tmp]=1;
			GetPlayerName(tmp,name,sizeof(name));
			format(tmp2,sizeof(tmp2),"Unmuted %s [ID:%i]",name,tmp);
			SendClientMessage(playerid, 0x33AA3300, tmp2);
			return 1;
		}
	}
}
Reply
#9

Thankyou verymuch. I will get back to you if it works.

Ill test it in like 10 min.


Rick
Reply
#10

all you need to do now is add some way of telling if the person is admin
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)