[VORTEX GM] How to change local OOC chat.
#1

Hello, as the title says, I want to change /b to ( only for example when you say (hi, it happears (( hi )) but whenever I try to make it, it gives me errors, could you help me out please?

heres the /b

Код:
command(b, playerid, params[])
{
	new Message[128], string[128];
	if(sscanf(params, "z", Message))
	{
		SendClientMessage(playerid, WHITE, "SYNTAX: /b [message]");
	}
	else
	{
	    if(strlen(Message) < 1 || !IsPlayerConnectedEx(playerid))
	    {
	        return 1;
	    }
	    else
	    {
	        if(Player[playerid][PrisonID] == 1)
	        {
				SendClientMessage(playerid, WHITE, "You may not use this channel right now.");
	        }
	        else
	        {
		    	format(string, sizeof(string), "%s says: ((%s)) ", GetName(playerid), Message);
				NearByMessage(playerid, WHITE, string);
			}
		}
	}
	return 1;
}
Reply
#2

Could you at least show us the errors, dude.
Reply
#3

Well whenever I try to do best I can like,

Код:
command( (, playerid, params[])
{
	new Message[128], string[128];
	if(sscanf(params, "z", Message))
	{
		SendClientMessage(playerid, WHITE, "SYNTAX: /b [message]");
	}
	else
	{
	    if(strlen(Message) < 1 || !IsPlayerConnectedEx(playerid))
	    {
	        return 1;
	    }
	    else
	    {
	        if(Player[playerid][PrisonID] == 1)
	        {
				SendClientMessage(playerid, WHITE, "You may not use this channel right now.");
	        }
	        else
	        {
		    	format(string, sizeof(string), "%s says: ((%s)) ", GetName(playerid), Message);
				NearByMessage(playerid, WHITE, string);
			}
		}
	}
	return 1;
}
or

Код:
command:(, (playerid, params[])
{
	new Message[128], string[128];
	if(sscanf(params, "z", Message))
	{
		SendClientMessage(playerid, WHITE, "SYNTAX: /b [message]");
	}
	else
	{
	    if(strlen(Message) < 1 || !IsPlayerConnectedEx(playerid))
	    {
	        return 1;
	    }
	    else
	    {
	        if(Player[playerid][PrisonID] == 1)
	        {
				SendClientMessage(playerid, WHITE, "You may not use this channel right now.");
	        }
	        else
	        {
		    	format(string, sizeof(string), "%s says: ((%s)) ", GetName(playerid), Message);
				NearByMessage(playerid, WHITE, string);
			}
		}
	}
	return 1;
}
it fails
Reply
#4

pawn Код:
if(sscanf(params, "z", Message)) //From
if(sscanf(params, "s[128]", Message)) //To
idk if it solves the errors, because i dont know the errors
Reply
#5

This is what I got

Код:
C:\Documents and Settings\diingO\Ambiente de trabalho\SM-RPG V.1.0 R1\gamemodes\SM-RPG.pwn(15577) : error 010: invalid function or declaration
C:\Documents and Settings\diingO\Ambiente de trabalho\SM-RPG V.1.0 R1\gamemodes\SM-RPG.pwn(29133) : warning 203: symbol is never used: "command"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
1 Error.

Код:
15577: 			                	command((, playerid, params[])
Reply
#6

Please
Reply
#7

do

pawn Код:
command(b, playerid, params[])
Reply
#8

Quote:
Originally Posted by ScopE iMarkx
Посмотреть сообщение
do

pawn Код:
command(b, playerid, params[])
it will fail, because you have to type COMMAND in caps

anyway try this one (not tested)
pawn Код:
COMMAND:b(playerid, params[])
{
    if(Player[playerid][PrisonID] == 1) return SendClientMessage(playerid, WHITE, "You may not use this channel right now.");
    else if(strlen(params) > 0)
    {
        new string[128];
        format(string, sizeof(string), "%s says: ((%s))", GetName(playerid), params);
        NearByMessage(playerid, WHITE, string);
    }
    else SendClientMessage(playerid, 0xFF0000FF, "SYNTAX: /b [message]");
    return 1;
}
Reply
#9

But I dont want B mate, I already had B, I want to change /b to ( only for example when you say (hi, it happears (( hi )) thats why its ( there -.-
Reply
#10

You mean if you do "/hi" then the message (( Hi )) will appear to near by players
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)