Zcmd String Issue
#6

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:

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


Messages In This Thread
Zcmd String Issue - by [UG]Scripter - 23.11.2010, 07:26
Re: Zcmd String Issue - by Rac3r - 23.11.2010, 07:36
Re: Zcmd String Issue - by [UG]Scripter - 23.11.2010, 08:17
Re: Zcmd String Issue - by cessil - 23.11.2010, 08:44
Re: Zcmd String Issue - by iggy1 - 23.11.2010, 09:26
Re: Zcmd String Issue - by Slice - 23.11.2010, 09:44

Forum Jump:


Users browsing this thread: 1 Guest(s)