"/say [text]" -----> "// [text]" - Help please -
introzen - 22.06.2010
Hey people....
I got this command:
pawn Код:
dcmd_say(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return 1;
new string[128], server[128];
if(sscanf(params, "s", server)) return SendHelpMessage(playerid, ".: Usage: // [text] :.");
format(string, sizeof(string), "(( %s %s: %s ))", AdminRankName(playerid), pName(playerid), server);
SendClientMessageToAll(COLOR_YELLOW2, string);
return 1;
}
But I want it to be "//" instead of "/say"
And that gives me shit lots of errors with dcmd... so how to fix ?
Thank you
Re: "/say [text]" -----> "// [text]" - Help please -
Mike Garber - 22.06.2010
// makes the line commented, as you see in your quote // text becomes green.
That means this code will be ignored just as if it didn't exist.
This is also why It gives you errors upon compiling the script.
I don't think It will be possible to create such command prefix.
Re: "/say [text]" -----> "// [text]" - Help please -
introzen - 23.06.2010
Quote:
Originally Posted by mavtias
// makes the line commented, as you see in your quote // text becomes green.
That means this code will be ignored just as if it didn't exist.
This is also why It gives you errors upon compiling the script.
I don't think It will be possible to create such command prefix.
|
It doesn't make it a comment as it is inside 2 quote signs.... Just the pawn script in the forum that thinks so...
This is possible. I've seen it...
Re: "/say [text]" -----> "// [text]" - Help please -
Mike Garber - 23.06.2010
Well, use the good old strcmp for that command only then? :P
Re: "/say [text]" -----> "// [text]" - Help please -
introzen - 23.06.2010
dont know how lol
Re: "/say [text]" -----> "// [text]" - Help please -
Mike Garber - 23.06.2010
Quote:
Originally Posted by IntrozeN
dont know how lol
|
pawn Код:
if(strcmp(cmd, "//say", true) == 0)
{
// command
return 1;
}
Re: "/say [text]" -----> "// [text]" - Help please -
Fj0rtizFredde - 23.06.2010
pawn Код:
if(!strcmp(cmdtext, "//say", true, 5))
{
if (IsPlayerAdmin(playerid))
{
if(!strlen(cmdtext[5])) return SendClientMessage(playerid, COLOR, "USE: //say <text>");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s: %s" ,sendername, cmdtext[5]);
SendClientMessageToAll(color, string);
return 1;
}
else return SendClientMessage(playerid, RED, "You are not an admin!");
}
Idk if it will work :P I wrote it inside the forum :P Buy you get the point how it works :P
Re: "/say [text]" -----> "// [text]" - Help please -
(.Aztec); - 23.06.2010
You'll have to do it in OnPlayerText instead of OnPlayerCommandText, because it's technically not a command.
Re: "/say [text]" -----> "// [text]" - Help please -
introzen - 23.06.2010
I don't want it to be //say, I want it to be //
Re: "/say [text]" -----> "// [text]" - Help please -
Mike Garber - 23.06.2010
Quote:
Originally Posted by Sky4D
You'll have to do it in OnPlayerText instead of OnPlayerCommandText, because it's technically not a command.
|
Wrong.
Well, If you want it to be just //, change It to that.