Command Not Working Correctly
#1

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.
Reply
#2

I'll try to help ya
Reply
#3

show us the code..
Reply
#4

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...
Reply
#5

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

someone?
Reply
#7

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;
    }
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)