/do for RP scripts
#1

Hey I'm trying to script a /do command for my RP server.

For anyone who isnt used to RP commands, /do is an explenation of the envoriorment.

IE - The trunk has a black create inside it.


I came up with something I think would work but I'm having some problems with it.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/do", cmdtext, true, 10) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(gPlayerLogged[playerid] == 0)
	    {
	      SendClientMessage(playerid, COLOR_GREY, "  You havent logged in yet !");
	      return 1;
	    }
  			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /do [environment]");
				return 1;
  		}
			format(string, sizeof(string), "* %s %s", sendername, result);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			printf("%s", string);
		}
		return 1;
	}
	return 0;
}
Anyone could help me out?

P.S The Code tags made things jump indentations.
Reply
#2

is it like /me?
Reply
#3

Код:
  			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /do [environment]");
				return 1;
  		}
			format(string, sizeof(string), "* %s %s", sendername, result);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			printf("%s", string);
		}
wTf? I know what you need, it's quite simple, but what is that, there's one IF statemen in wrong place, then there is 1 "{" and 2 "}", i think, complicator can't get that place, I totaly can't...
Reply
#4

It is like /me, but more for explaining things such as sounds or things people see, like

instead of saying

Joe: There is a Black Create in the car.

And

Joe is wearing a black hat. - /me

I want

There is a Black Create In the car. - Comes up with no names, just a Client message to people withen distance of the person who did the command.

Reply
#5

I see no variable "result" assign place, does it exist at all? Maybe you are just trying to print and clientmessage nothing....
Reply
#6

Quote:
Originally Posted by RSX
I see no variable "result" assign place, does it exist at all? Maybe you are just trying to print and clientmessage nothing....
Explain?

Код:
format(string, sizeof(string), "* %s %s", sendername, result);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)