Command
#3

I did it with ZCMD + sscanf2:
pawn Код:
CMD:suspect( playerid, params[] )
{
    new tempname, tempreason[ 70 ], tempwanted;
        if ( sscanf( params, "us[ 70 ]i", tempname, tempreason, tempwanted ) )
        return SendClientMessage( playerid, -1, "Usage: /awanted <PlayerID> <Reason> [WantedLevel]");

    if ( !IsPlayerConnected( tempname ) )
        return SendClientMessage( playerid, -1, ""COL_RED"Player is not connected.");
   
    SetPlayerWantedLevel( tempname, tempwanted );
    return 1;
}
CMD:su( playerid, params[] ) return cmd_suspect( playerid, params );
tempname = playerid
tempreason = crime decscription
tempwanted = wanted level

So, it works like: "/suspect antonio112 Speeding 1". This will give the suspect a level 1 wanted for Speeding.
About the CMD: su ... it`s so you can use like /su or /suspect, which do exactly the same.

Now, this is a simple example.
Reply


Messages In This Thread
Command - by GeonMake - 11.03.2011, 22:32
Re: Command - by airsoft - 11.03.2011, 23:48
Re: Command - by antonio112 - 11.03.2011, 23:58
Re: Command - by airsoft - 12.03.2011, 00:42
Re: Command - by antonio112 - 12.03.2011, 00:48

Forum Jump:


Users browsing this thread: 1 Guest(s)