Fixing parameter cmds
#5

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
Try using
PHP код:
   CMD:afk(playerid,params[])
    {
        new 
targetidstring[128];
        if(
sscanf(params,"d",targetidtargetid)) return SendClientMessage(playerid, -1,"CMD: /afk [ID]");
          if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""COL_RED"Player is not online!");
        if(
IsPlayerMoving(targetid) == 0)
        {
            
format(stringsizeof(string), "%s is AFK for %d seconds",PlayerName(targetid), AFKTime[targetid]);
            
SendClientMessage(playerid,-1,string);
        }
        else
        {
            
SendClientMessage(playerid,-1,"This player is not AFK");
        }
        return 
1;
    } 
better than params[0]
Should be like this.
Код:
if(sscanf(params,"d",targetid)) return SendClientMessage(playerid, -1,"CMD: /afk [ID]");
Reply


Messages In This Thread
Fixing parameter cmds - by Zeus666 - 07.10.2018, 12:05
Re: Fixing parameter cmds - by Ferman - 07.10.2018, 14:53
Re: Fixing parameter cmds - by Zeus666 - 07.10.2018, 15:01
Re: Fixing parameter cmds - by v1k1nG - 07.10.2018, 15:29
Re: Fixing parameter cmds - by UFF - 07.10.2018, 15:35
Re: Fixing parameter cmds - by v1k1nG - 07.10.2018, 15:36
Re: Fixing parameter cmds - by Dennis12 - 07.10.2018, 16:10
Re: Fixing parameter cmds - by Zeus666 - 07.10.2018, 18:52
Re: Fixing parameter cmds - by Zeus666 - 07.10.2018, 22:20
Re: Fixing parameter cmds - by v1k1nG - 07.10.2018, 22:48

Forum Jump:


Users browsing this thread: 1 Guest(s)