15.07.2011, 12:32
(
Последний раз редактировалось Gramercy Riffs; 15.07.2011 в 13:28.
)
This is my /low command:
Whenever I type just "/low" in-game, it comes up saying: "SERVER: /low <text>" which is perfectly fine. But whenever I add text to the command, say for example: "/low Hello" it will come up with: "SERVER: /low <text>"
Any help, please?
pawn Код:
stock SendClosestMessage( playerid, color, const string[ ] )
{
new
Float: jPos[ 3 ]
;
GetPlayerPos( playerid, jPos[ 0 ], jPos[ 1 ], jPos[ 2 ] );
for ( new j = GetMaxPlayers( ), i; i < j; i ++ )
{
if ( !IsPlayerConnected( i ) )
continue;
if ( IsPlayerInRangeOfPoint( i, 7.0, jPos[ 0 ], jPos[ 1 ], jPos[ 2 ] ) )
{
SendClientMessage( i, color, string );
}
}
return 1;
}
stock RemoveUnderScore(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if ( !strcmp( cmdtext, "/low", true, 3 ) )
{
if ( cmdtext[ 3 ] != ' ' || !cmdtext[ 4 ] )
return SendClientMessage( playerid, -1, "SERVER: /low <text>" );
new
tempString[ 128 ],
pName[ 24 ]
;
GetPlayerName( playerid, pName, sizeof pName );
format( tempString, sizeof tempString, "*%s says [Low]: %s", RemoveUnderScore(playerid), cmdtext[ 3 ] );
SendClosestMessage( playerid, COLOR_WHITE, tempString );
return 1;
}
return 0;
}
Any help, please?