Repeating 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Repeating Problem! (
/showthread.php?tid=259891)
Repeating Problem! -
cloudysky - 06.06.2011
pawn Код:
command(test, playerid, params[])
{
if(PlayerInfo[playerid][BT1] >= 0 )
{
SendClientMessage(playerid, COLOUR_LGREEN, "DONE" );
PlayerInfo[playerid][BT1] = 1;
PlayerInfo[playerid][TasksComplete]++;
}
return 1;
}
Every time I use /test it says DONE even though BT1 = 1 Is it the way i have scripted it? Please help!
Re: Repeating Problem! -
Tee - 06.06.2011
You are checking if it is equal or more than 0, then complete the command. So if it is 0 then it would complete the command, and if it is more than 0 (Let's say 1) it would still complete it.
pawn Код:
command(test, playerid, params[])
{
if(PlayerInfo[playerid][BT1] == 0)
{
SendClientMessage(playerid, COLOUR_LGREEN, "DONE" );
PlayerInfo[playerid][BT1] = 1;
PlayerInfo[playerid][TasksComplete]++;
}
else return SendClientMessage(playerid,-1,"NOT DONE.");//You can remove this line, it's just for debugging reasons.
return 1;
}
Re: Repeating Problem! -
sansko - 06.06.2011
pawn Код:
command(test, playerid, params[])
{
if(PlayerInfo[playerid][BT1] <= 0 )// edited for smaller then instead of larger then
{
SendClientMessage(playerid, COLOUR_LGREEN, "DONE" );
PlayerInfo[playerid][BT1] = 1;
PlayerInfo[playerid][TasksComplete]++;
}
return 1;
}
use this
Re: Repeating Problem! -
Tee - 06.06.2011
That could also work if he is setting the variable to -1 etc, also for 0.