SA-MP Forums Archive
Command Not Working Correctly - 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: Command Not Working Correctly (/showthread.php?tid=109256)



Command Not Working Correctly - laserhel50 - 18.11.2009

hey Guys,i am at the moment Learning how to script, small things of Course.
But i got a small Problem, Script Working, so okay, i go Test... Opened Gate, Closed Gate and then it did not worked anymore...
i was like wtf...


Couldt someone help mewith this?? thx.


Re: Command Not Working Correctly - LarzI - 18.11.2009

I'll try to help ya


Re: Command Not Working Correctly - agusfn20 - 18.11.2009

show us the code..


Re: Command Not Working Correctly - laserhel50 - 18.11.2009

its Very Simple

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/opene69", cmdtext, true, 10) == 0)
	{
		if(IsPlayerInRangeOfPoint(playerid, 7.0, -1523.627808, 481.981415, 6.207134))
		{
		MoveObject(Agate, -1535.559692, 481.989716, 6.179688, 2.00);
		SendClientMessage(playerid, COLOR_RED, "Gate Opened Automaticly");
		}
		return 1;
		}
		
	if (strcmp("/closee69", cmdtext, true, 10) == 0)
		{
		if(IsPlayerInRangeOfPoint(playerid, 7.0, -1523.627808, 481.981415, 6.207134))
		{
		MoveObject(Agate, -1523.627808, 481.981415, 6.207134, 2.00);
		SendClientMessage(playerid, COLOR_RED, "Gate Closed Automaticly");
		}
		return 1;
		}
	return 1;
	}
changing the return 0; 's to 1's worked a bit better, he hitted 3 times working...


Re: Command Not Working Correctly - laserhel50 - 18.11.2009

i think i got it working, but when i do close, it gives unknown command Option but still works...



Re: Command Not Working Correctly - laserhel50 - 19.11.2009

someone?


Re: Command Not Working Correctly - [03]Garsino - 19.11.2009

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/opene69", cmdtext, true, 8) == 0) // You had "10" showing instead of "8". The number 8=How long the command is with the "/"
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, -1523.627808, 481.981415, 6.207134))
        {
        MoveObject(Agate, -1535.559692, 481.989716, 6.179688, 2.00);
        SendClientMessage(playerid, COLOR_RED, "Gate Opened Automaticly");
        }
        return 1;
        }
       
    if (strcmp("/closee69", cmdtext, true, 9) == 0) // You had "10" showing instead of "9". The number 9=How long the command is with the "/"
        {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, -1523.627808, 481.981415, 6.207134))
        {
        MoveObject(Agate, -1523.627808, 481.981415, 6.207134, 2.00);
        SendClientMessage(playerid, COLOR_RED, "Gate Closed Automaticly");
        }
        return 1;
        }
    return 1;
    }