SA-MP Forums Archive
afk problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: afk problem (/showthread.php?tid=427401)



afk problem - NicholasA - 01.04.2013

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/afk", cmdtext, true, 10) == 0)
	{
		if (isafk)
		    SendClientMessage(playerid, "You are no longer AFK.");
		    isafk = false;
		else
		    SendClientMessage(playerid, "You are now AFK.");
		    isafk = true;
		#end if
		return 1;
	}
	return 0;
}
Gives me this
Код:
C:\Users\x3990.003\Desktop\samp server\filterscripts\AFKsystem.pwn(21) : error 035: argument type mismatch (argument 2)
C:\Users\x3990.003\Desktop\samp server\filterscripts\AFKsystem.pwn(22) : warning 217: loose indentation
C:\Users\x3990.003\Desktop\samp server\filterscripts\AFKsystem.pwn(23) : warning 217: loose indentation
C:\Users\x3990.003\Desktop\samp server\filterscripts\AFKsystem.pwn(23) : error 029: invalid expression, assumed zero
C:\Users\x3990.003\Desktop\samp server\filterscripts\AFKsystem.pwn(24) : warning 217: loose indentation
C:\Users\x3990.003\Desktop\samp server\filterscripts\AFKsystem.pwn(24) : error 035: argument type mismatch (argument 2)
C:\Users\x3990.003\Desktop\samp server\filterscripts\AFKsystem.pwn(26) : error 031: unknown directive
C:\Users\x3990.003\Desktop\samp server\filterscripts\AFKsystem.pwn(26 -- 27) : warning 215: expression has no effect
C:\Users\x3990.003\Desktop\samp server\filterscripts\AFKsystem.pwn(27) : error 001: expected token: ";", but found "return"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.



Re: afk problem - SuperViper - 01.04.2013

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/afk", cmdtext, true, 10) == 0)
    {
        if(isafk)
        {
            SendClientMessage(playerid, "You are no longer AFK.");
            isafk = false;
        }
        else
        {
            SendClientMessage(playerid, "You are now AFK.");
            isafk = true;
        }

        return 1;
    }

    return 0;
}



Re: afk problem - NicholasA - 01.04.2013

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/afk", cmdtext, true, 10) == 0)
    {
        if(isafk)
        {
            SendClientMessage(playerid, "You are no longer AFK.");
            isafk = false;
        }
        else
        {
            SendClientMessage(playerid, "You are now AFK.");
            isafk = true;
        }

        return 1;
    }

    return 0;
}
Thank you I forgot we used brackets in pawn


Re: afk problem - iGetty - 01.04.2013

https://sampforum.blast.hk/showthread.php?tid=427392

I already replied.