Help with /fakecmd command +Rep
#3

pawn Код:
CMD:forcecmd(playerid, params[])
{
    if(PInfo[playerid][Admin] < 1336) return SCM(playerid, grey,AdmError);
    else
    {
        #if !defined isnull
            #define isnull(%1) \
                    ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
        #endif
        new Target;
        new cmdParams[50];
        new cmdToForce[50];
        sscanf(params, "us[50]s[50]", Target, cmdToForce, cmdParams);
        if(isnull(cmdToForce)) SCM(playerid,comandos,"Use < /forcecmd [id/name] [command] [parameters] >");
        else
        {
            if(!IsPlayerConnected(Target)) SCM(playerid,grey,"  Invalid ID/Name!");
            else
            {
                format(cmdToForce, sizeof(cmdToForce), "cmd_%s", cmdToForce);
                if(funcidx(cmdToForce) != -1)
                {
                    if(isnull(cmdParams)) CallLocalFunction(cmdToForce, "i", Target);
                    else CallLocalFunction(cmdToForce, "is", Target, cmdParams);
                    SCM(playerid,greenseco,"# Command forced");
                }
                else SCM(playerid,grey,"  Invalid Command/Parameter!");
            }
        }
    }
    return 1;
}
Just edit...
Reply


Messages In This Thread
<remove> - by freeze98 - 31.08.2014, 20:22
Re: Help with /fakecmd command +Rep - by LeroyII - 31.08.2014, 20:52
Re: Help with /fakecmd command +Rep - by StreetGT - 31.08.2014, 21:07
Re: Help with /fakecmd command +Rep - by Abagail - 31.08.2014, 21:44
<remove> - by freeze98 - 01.09.2014, 09:11
Re: Help with /fakecmd command +Rep - by DavidBilla - 01.09.2014, 12:29
Re: Help with /fakecmd command +Rep - by freeze98 - 01.09.2014, 18:39

Forum Jump:


Users browsing this thread: 1 Guest(s)