SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 11/08/2009, 09:36 AM   #1
retart441
Big Clucker
 
Join Date: Jul 2009
Posts: 171
Reputation: 3
Default /do for RP scripts

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.

Code:
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.
retart441 is offline  
Old 11/08/2009, 09:44 AM   #2
WardenCS
Gangsta
 
WardenCS's Avatar
 
Join Date: Feb 2009
Posts: 899
Reputation: 14
Default Re: /do for RP scripts

is it like /me?
__________________
WardenCS

My creations
[Filterscript]Shoeties
[Filterscript]Body system


Request your scripts/snippets from me, PM me.
WardenCS is offline  
Old 11/08/2009, 09:45 AM   #3
RSX
Huge Clucker
 
RSX's Avatar
 
Join Date: Dec 2007
Location: GMT+2
Posts: 338
Reputation: 4
Default Re: /do for RP scripts

Code:
  			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...
__________________
HACKED PAWN MEMORY
Log for OXP+ Precompiler :
Done making basic operations... Up next : Finishing basic class {} framework Up next 2 : Making basic rewrite to destination Up next 3 : Making destination options.
RSX is offline  
Old 11/08/2009, 10:03 AM   #4
retart441
Big Clucker
 
Join Date: Jul 2009
Posts: 171
Reputation: 3
Default Re: /do for RP scripts

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.

retart441 is offline  
Old 11/08/2009, 10:08 AM   #5
RSX
Huge Clucker
 
RSX's Avatar
 
Join Date: Dec 2007
Location: GMT+2
Posts: 338
Reputation: 4
Default Re: /do for RP scripts

I see no variable "result" assign place, does it exist at all? Maybe you are just trying to print and clientmessage nothing....
__________________
HACKED PAWN MEMORY
Log for OXP+ Precompiler :
Done making basic operations... Up next : Finishing basic class {} framework Up next 2 : Making basic rewrite to destination Up next 3 : Making destination options.
RSX is offline  
Old 11/08/2009, 10:17 AM   #6
retart441
Big Clucker
 
Join Date: Jul 2009
Posts: 171
Reputation: 3
Default Re: /do for RP scripts

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?

Code:
format(string, sizeof(string), "* %s %s", sendername, result);
retart441 is offline  
 

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
Big Scripts.Inc Criss_Angel Help Archive 17 14/07/2009 09:27 AM
Big Scripts.Inc Criss_Angel Help Archive 0 07/07/2009 08:44 PM
Big Scripts.Inc Criss_Angel Help Archive 2 05/07/2009 10:40 PM
how to add scripts WardenCS Help Archive 0 10/04/2009 08:21 PM


All times are GMT. The time now is 09:47 AM.


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