having some questions... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: having some questions... (
/showthread.php?tid=88489)
having some questions... -
agusfn20 - 27.07.2009
Whatґs the difference of return 0 or return 1?
and
i am making a parking sistem so when you type /join, your name is put in "parking.txt" and if you want to open the gate your name must be inside the file
sorry my bad english
Re: having some questions... -
[DD]FlameOFDeath - 27.07.2009
The difrence between return 1 and return 0:
Return 1; (so u can add more script on to it for e.g.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/commands", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA3333A,"find your command stuff here");
return 1;
}
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA3333A,"Text");
SendClientMessage(playerid,0xAA3333A,"Text");
SendClientMessage(playerid,0xAA3333A,"Text");
return 1;
}
return 0;
Return 0; ends that Public (cmd)
thats what it dose i think
im not to sure about the other on lol
hope it helps not much though i guess
Re: having some questions... -
Joe Staff - 27.07.2009
Lol that's wrong. Return means the end of a callback or function. the number beside it determines what value the function or callback will give when it's used.
For example:
pawn Код:
ExampleFunction(playerid)
{
if(playerid==stupid)return 1;
if(playerid==bacon)return 5;
return 0;
}
//someplace else
if(ExampleFunction(24)) // This can equal 1, 5, or 0 depending on what it returns
{
SendClientMessage(playerid,0xFF0000FF,"You suck!");
}else{
SendClientMessage(playerid,0xFF0000FF,"I'm indifferent towards you!");
}
Hope that helps