#1

when i use the say command/announce/pm it doesn't write anything exept numbers (if i will try to write a - it won't do anything but with numbers it works perfect...)
codeno errors)
PHP код:
if(strcmp(cmd"/say"true) == 0)
{
new 
tmp[256];
tmp strtok(cmdtextidx);
if(!
strlen(tmp)){
SendClientMessage(playeridCOLOUR_ORANGE"Usage: /say [text]");
return 
1;
}
new 
text;
text strval(tmp);
new 
playername[MAX_PLAYER_NAME];
GetPlayerName(playeridplayernamesizeof(playername));
new 
string[128];
format(stringsizeof(string), "**Admin [%s](id:%d): %s"playernameplayeridtext);
SendClientMessageToAll(COLOUR_REDstring);
return 
1;

Reply
#2

Use [ pawn ] instead of [ php ]
Anyways, here is the fix:
pawn Код:
if(strcmp(cmd, "/say", true) == 0)
{
    if ( !strlen( cmdtext ) )
        return SendClientMessage( playerid, COLOUR_ORANGE, "Usage: /say [text]" );
    new playername[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, playername, sizeof playername );
    new string[ 128 ];
    format( string, sizeof string, "**Admin [%s](id:%d): %s", playername, playerid, cmdtext ); // I changed this also
    return SendClientMessageToAll( COLOUR_RED, string );
}
I just changed strtok, since you don't need it in here.
Reply
#3

Quote:
Originally Posted by Mean
Посмотреть сообщение
Use [ pawn ] instead of [ php ]
Anyways, here is the fix:
pawn Код:
if(strcmp(cmd, "/say", true) == 0)
{
    if ( !strlen( cmdtext ) )
        return SendClientMessage( playerid, COLOUR_ORANGE, "Usage: /say [text]" );
    new playername[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, playername, sizeof playername );
    new string[ 128 ];
    format( string, sizeof string, "**Admin [%s](id:%d): %s", playername, playerid, cmdtext ); // I changed this also
    return SendClientMessageToAll( COLOUR_RED, string );
}
I just changed strtok, since you don't need it in here.
thx but i still got a problem... when i write /say or /ann it says the command too... like if i will write /say hi
it will write **Admin[omer5198](id:0)/say hi... see the problem? i want it to say only the hi not the /say... same with /ann
Reply
#4

**********anyone?********
Reply
#5

pawn Код:
if(strcmp(cmd, "/say", true) == 0)
{
    if(!strlen(cmdtext)) return SendClientMessage(playerid, COLOR_RED, "Usage: /asay [Text] ");
    new PlayerName[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    format(string, sizeof(string), "**Admin [%s](id:%d): %s", PlayerName, playerid, cmdtext[0]);
    SendClientMessageToAll(COLOR_RED,string);
    return 1;
}
Reply
#6

Quote:
Originally Posted by Clive
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/say", true) == 0)
{
    if(!strlen(cmdtext)) return SendClientMessage(playerid, COLOR_RED, "Usage: /asay [Text] ");
    new PlayerName[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    format(string, sizeof(string), "**Admin [%s](id:%d): %s", PlayerName, playerid, cmdtext[0]);
    SendClientMessageToAll(COLOR_RED,string);
    return 1;
}
sorry but still... doesn't work:
picture:
Reply
#7

pawn Код:
format(string, sizeof(string), "**Admin [%s](id:%d): %s", PlayerName, playerid, cmdtext[5]);
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
pawn Код:
format(string, sizeof(string), "**Admin [%s](id:%d): %s", PlayerName, playerid, cmdtext[5]);
thx works great!!! exept that if i write /say or /ann without anything it acctuly write /say or /ann (/ann in gametext and /say in clientmessagetoall...)
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)