[Help] Basic Question
#7

Use ZCMD and sscanf.

pawn Код:
COMMAND:healplayer( playerid, params [ ] )
{
    if ( IsPlayerAdmin ( playerid ) ) //Change to likings
    {
        new
            tPlayer,
        ;
        if ( sscanf ( params, "u", tPlayer ) ) return SendClientMessage ( playerid, 0xFFFFFFAA, "SYNTAX: `| /healplayer [ Target player or name ]`" );
        else
        {
            SetPlayerHealth ( tPlayer, 100.0 );
        }
    }
    return 1;
}

If you're new to scripting Pawn in SA:MP you should start using scripts that can help a lot such as using MySQL, zcmd, foreach, sscanf and a few others.
Reply


Messages In This Thread
[Help] Basic Question - by rubygta - 09.12.2010, 19:52
Re: [Help] Basic Question - by CyNiC - 09.12.2010, 19:54
Re: [Help] Basic Question - by rubygta - 09.12.2010, 19:58
Re: [Help] Basic Question - by blackwave - 09.12.2010, 20:12
Re: [Help] Basic Question - by rubygta - 09.12.2010, 20:20
Re: [Help] Basic Question - by Hal - 09.12.2010, 20:24
Re: [Help] Basic Question - by Retardedwolf - 09.12.2010, 20:27

Forum Jump:


Users browsing this thread: 1 Guest(s)