15.07.2018, 22:12
It's pretty simple, don't understand all the complications in this post. And also, GetPVarString returns the length of the string, not the string value. You can't plug it into strmid.
Haven't compiled it, should work though.
PHP код:
CMD:accent( playerid, cmdtext[] )
{
if(strlen( cmdtext ) < 9 )
{
SendClientMessage( playerid, 0xFFFFFFFF, "USAGE: /accent [text]" );
return 1;
}
new
szString[ 120 ];
SetPVarString( playerid, "Accent", cmdtext );
format( szString, sizeof( szString ), "You have set your accent to %s.", cmdtext );
SendClientMessage( playerid, 0x33CCFFAA, szString );
return 1;
}
public OnPlayerText( playerid, text[] )
{
new szText[ 128 ];
if( realchat )
{
new szAccent[ 60 ];
GetPVarString( playerid, "Accent", szAccent, sizeof( szAccent ) );
if( !isnull( szAccent ) ) {
format( szText, sizeof( szText ), "[%s] %s says: %s", szAccent, GetName( playerid ), text );
} else {
format( szText, sizeof( szText ), "%s says: %s", GetName( playerid ), text );
}
ProxDetector( 30.0, playerid, szText ,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION,COLOR_CORRECTION );
format( szText, sizeof( szText ), "says: %s", text );
SetPlayerChatBubble( playerid, szText, COLOR_YELLOW, 5.0, 5000 );
ApplyAnimation(playerid,"PED","IDLE_CHAT",2.0,1,0,0,1,1);
return 0;
}
IdleTime[ playerid ] = 0;
return 1;
}