23.11.2010, 09:44
Luckily I was on a caffeinie buzz.
What you did wrong was create an empty variable called "cmdtext" then use it. The variable called "params" contains the command string except for the first part.
I think this should work:
What you did wrong was create an empty variable called "cmdtext" then use it. The variable called "params" contains the command string except for the first part.
I think this should work:
pawn Код:
COMMAND:r( playerid, params )
{
if ( isnull( params ) )
{
SendClientMessage( playerid, -1, "USAGE: /r [text]" );
return 1;
}
new
UnitIdentifier[ 512 ],
playername[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, playername, sizeof( playername ) );
UnitIdentifier = dini_Get( "UnitIDs.txt", playername );
new erpstring[ 128 ];
if ( PlayerTeam[ playerid ] == Team_Sheriff || PlayerTeam[ playerid ] == Team_LVPD || PlayerTeam[ playerid ] == Team_Fire )
{
if ( dini_Exists( "UnitIDs.txt" ) )
{
if ( strlen( dini_Get( "UnitIDs.txt", playername ) ) != 0 )
{
GetPlayerName( playerid, playername, sizeof( playername ) );
format( erpstring, sizeof( erpstring ), "(DCPCOM) %s %d: %s, over.", UnitIdentifier, playerid, params );
SendMessageToLaw( erpstring );
}
else
{
GetPlayerName( playerid, playername, sizeof( playername ) );
format( erpstring, sizeof( erpstring ), "(DCPCOM) Unit %d: %s, over.", playerid, params );
SendMessageToLaw( erpstring );
SendClientMessage( playerid, COLOR_YELLOW, erpstring );
}
}
}
return 1;
}