OnPlayerText Help
#1

Код:
if(text[0] == '#' && PlayerInfo[playerid][gleader] == 1) {
	    new string[128]; GetPlayerName(playerid,string,sizeof(string));
		format(string,sizeof(string),"Gang.Chat:[%i]%s: %s",playerid,string,text[1]);
		MessageToGang(0x8000FFC8,string);
	    return 0;
	}
Ok so, this is the code for my GM's gang leader(s) chat and I want it to ##[text] for gang members chat
Couldnt get anything on samp forum so I am posting here for help

For Example My gang members chat should be like this or whatever

Код:
if(text[0] == '##' && PlayerInfo[playerid][gleader] == 1) {
	    new string[128]; GetPlayerName(playerid,string,sizeof(string));
		format(string,sizeof(string),"Gang.Chat:[%i]%s: %s",playerid,string,text[1]);
		MessageToGang(0x8000FFC8,string);
	    return 0;
	}
But this gives error.

Any kind of help would be appreciated.


Plus I am noob at scripting and I want Help for a command that could write anything in the textdraw box.
I am using Arakuta's SendBoxMsg!
This is just a side thing if any help is given I would be really Happy!
Reply
#2

try this

pawn Код:
if(text[0] == '#' && text[1] == '#' && PlayerInfo[playerid][gleader] == 1) {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"Gang.Chat:[%i]%s: %s",playerid,string,text[1]);
        MessageToGang(0x8000FFC8,string);
        return 0;
    }
Reply
#3

pawn Код:
GetPlayerName(playerid,string,MAX_PLAYER_NAME);
format(string,sizeof(string),"Gang.Chat:[%i]%s: %s",playerid,string,text[2]);
Reply
#4

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
try this

pawn Код:
if(text[0] == '#' && text[1] == '#' && PlayerInfo[playerid][gleader] == 1) {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"Gang.Chat:[%i]%s: %s",playerid,string,text[1]);
        MessageToGang(0x8000FFC8,string);
        return 0;
    }
it gets compiled but doesnt works
Reply
#5

anyone?
Reply
#6

pawn Код:
if(text[0] == '#' && text[1] == '#' && PlayerInfo[playerid][gleader] == 1) {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"Gang.Chat:[%i]%s: %s",playerid,string,text[1]);
        MessageToGang(0x8000FFC8,string);
        return 1; // Return 1 (?.
    }
Reply
#7

Does anybody read that post at all?

The solution is here and you seem to ignore it.
Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
GetPlayerName(playerid,string,MAX_PLAYER_NAME);
format(string,sizeof(string),"Gang.Chat:[%i]%s: %s",playerid,string,text[2]);
Reply
#8

Not a single thing in this post is working!
the pwn gets compiled but when I try to talk usin ##[text] ingame it doesnt happen!

Oh and I forgot to notify that I am using #[text] for gang leaders Chat!
Reply
#9

I guess this should work
pawn Код:
if(text[0] == '#' && text[1] == '#' && PlayerInfo[playerid][gleader] == 1) {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"Gang.Chat:[%i]%s: %s",playerid,string,text[2]);
        MessageToGang(0x8000FFC8,string);
        return 0;
    }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)