/do for RP scripts - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /do for RP scripts (
/showthread.php?tid=90932)
/do for RP scripts -
retart441 - 11.08.2009
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.
Re: /do for RP scripts -
WardenCS - 11.08.2009
is it like /me?
Re: /do for RP scripts -
RSX - 11.08.2009
Код:
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...
Re: /do for RP scripts -
retart441 - 11.08.2009
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.
Re: /do for RP scripts -
RSX - 11.08.2009
I see no variable "result" assign place, does it exist at all? Maybe you are just trying to print and clientmessage nothing....
Re: /do for RP scripts -
retart441 - 11.08.2009
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);