Help me with this simple code. - 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: Help me with this simple code. (
/showthread.php?tid=641191)
Help me with this simple code. -
Oxygenated - 12.09.2017
Help me with this when i try to compile i get errors
Код:
#include <a_samp>
#include <zcmd>
new Random;
public OnFilterScriptInIt()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
COMMAND:gifts(playerid, params[])
{
Random = random(3);
switch(Random)
{
case 0: // By Oxgenated {
GivePlayerMoney(playerid, 200);
SendClientMessage(playerid, -1, "You opened a gift and received $200.");
}
case 1: // Let's add some score to the user!
{
SetPlayerScore(playerid, GetPlayerScore(playerid)+2);
SendClientMessage(playerid, -1, "You opened a gift and received score.");
}
case 2: // By Oxygenated
{
GivePlayerMoney(playerid, 500);
SendClientMessage(playerid, -1, "You opened a gift and received $500.");
}
}
return 1;
}
PHP код:
C:\Users\Karan\Desktop\Samp\pawno\include\zcmd.inc(96) : warning 217: loose indentation
C:\Users\Karan\Desktop\Samp\pawno\include\zcmd.inc(97) : warning 217: loose indentation
C:\Users\Karan\Desktop\Samp\pawno\include\zcmd.inc(98) : warning 217: loose indentation
C:\Users\Karan\Desktop\Samp\pawno\Getgift.pwn(7) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInIt")
C:\Users\Karan\Desktop\Samp\pawno\Getgift.pwn(26) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Karan\Desktop\Samp\pawno\Getgift.pwn(26) : warning 215: expression has no effect
C:\Users\Karan\Desktop\Samp\pawno\Getgift.pwn(28) : error 010: invalid function or declaration
C:\Users\Karan\Desktop\Samp\pawno\Getgift.pwn(33) : error 010: invalid function or declaration
C:\Users\Karan\Desktop\Samp\pawno\Getgift.pwn(40) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Re: Help me with this simple code. -
Kane - 12.09.2017
Change
OnFilterScriptInIt() to OnFilterScriptInit.
Re: Help me with this simple code. -
Oxygenated - 12.09.2017
Nothing happened.
Re: Help me with this simple code. -
Meller - 12.09.2017
case 0: // By Oxgenated {
Commented bracket.
Re: Help me with this simple code. -
Oxygenated - 12.09.2017
Thanks alot! +rep