SA-MP Forums Archive
help - 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: help (/showthread.php?tid=224620)



help - omer5198 - 12.02.2011

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;




Re: help - Mean - 12.02.2011

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.


Re: help - omer5198 - 12.02.2011

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


Re: help - omer5198 - 12.02.2011

**********anyone?********


Re: help - HyperZ - 12.02.2011

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;
}



Re: help - omer5198 - 12.02.2011

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:



Re: help - Vince - 12.02.2011

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



Re: help - omer5198 - 12.02.2011

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...)