SA-MP Forums Archive
Commands not working - 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: Commands not working (/showthread.php?tid=581077)



Commands not working - aalbero99 - 10.07.2015

Hey, I have a problem, my server's commands don't work at all, they worked earlier but I change something and I don't remember how to make them work again >.< here's the code:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 	if (strcmp("/salir", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 933.206359, 2150.355224, 1011.023437))
    	{
    		SetPlayerPos(playerid, 2530.502197, -1664.375976, 15.166466);
    		SetPlayerInterior(playerid, 0);
		}
		return 1;
	}
 	if (strcmp("/entrar", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 2530.567871, -1664.283691, 15.166399))
	    {
	        SetPlayerPos(playerid, 933.206359, 2150.355224, 1011.023437);
	        SetPlayerInterior(playerid, 1);
		}
		return 1;
	}
	if (strcmp("/abrir1", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 960.474548, 2097.345703, 1011.022705))
		{
	        GivePlayerWeapon(playerid, 22, 50);
	        SetPlayerSkin(playerid, 28);
	 	}
	 	return 1;
	}
	if (strcmp("/abrir2", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 960.474548, 2097.345703, 1011.022705))
	    {
	        GivePlayerWeapon(playerid, 23, 50);
	        SetPlayerSkin(playerid, 180);
		}
		return 1;
	}
	if (strcmp("/abrir3", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 960.474548, 2097.345703, 1011.022705))
	    {
	        GivePlayerWeapon(playerid, 25, 50);
	        SetPlayerSkin(playerid, 29);
		}
		return 1;
	}
}



Re: Commands not working - Mouiz - 10.07.2015

try this:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
if (
strcmp("/salir"cmdtexttrue10) == 0)
{
if(
IsPlayerInRangeOfPoint(playerid3.0933.2063592150.3552241011.023437))
{
SetPlayerPos(playerid2530.502197, -1664.37597615.166466);
SetPlayerInterior(playerid0);
}
return 
1;
}
else if (
strcmp("/entrar"cmdtexttrue10) == 0)
{
if(
IsPlayerInRangeOfPoint(playerid3.02530.567871, -1664.28369115.166399))
{
SetPlayerPos(playerid933.2063592150.3552241011.023437);
SetPlayerInterior(playerid1);
}
return 
1;
}
else if (
strcmp("/abrir1"cmdtexttrue10) == 0)
{
if(
IsPlayerInRangeOfPoint(playerid3.0960.4745482097.3457031011.022705))
{
GivePlayerWeapon(playerid2250);
SetPlayerSkin(playerid2;
}
return 
1;
}
if (
strcmp("/abrir2"cmdtexttrue10) == 0)
{
if(
IsPlayerInRangeOfPoint(playerid3.0960.4745482097.3457031011.022705))
{
GivePlayerWeapon(playerid2350);
SetPlayerSkin(playerid180);
}
return 
1;
}
else if (
strcmp("/abrir3"cmdtexttrue10) == 0)
{
if(
IsPlayerInRangeOfPoint(playerid3.0960.4745482097.3457031011.022705))
{
GivePlayerWeapon(playerid2550);
SetPlayerSkin(playerid29);
}
return 
1;
}




Respuesta: Commands not working - aalbero99 - 10.07.2015

Nothing :/ still dont work, cant it have something to do with returns? S:


Re: Commands not working - Mouiz - 10.07.2015

wow,sorry,try this

Код:
public OnPlayerCommandText(playerid, cmdtext[]) 
{ 
if (strcmp("/salir", cmdtext, true, 10) == 0) 
{ 
if(IsPlayerInRangeOfPoint(playerid, 3.0, 933.206359, 2150.355224, 1011.023437)) 
{ 
SetPlayerPos(playerid, 2530.502197, -1664.375976, 15.166466); 
SetPlayerInterior(playerid, 0); 
}
} 
else if (strcmp("/entrar", cmdtext, true, 10) == 0) 
{ 
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2530.567871, -1664.283691, 15.166399)) 
{ 
SetPlayerPos(playerid, 933.206359, 2150.355224, 1011.023437); 
SetPlayerInterior(playerid, 1); 
} 
} 
else if (strcmp("/abrir1", cmdtext, true, 10) == 0) 
{ 
if(IsPlayerInRangeOfPoint(playerid, 3.0, 960.474548, 2097.345703, 1011.022705)) 
{ 
GivePlayerWeapon(playerid, 22, 50); 
SetPlayerSkin(playerid, 2; 
} 
} 
else if (strcmp("/abrir2", cmdtext, true, 10) == 0) 
{ 
if(IsPlayerInRangeOfPoint(playerid, 3.0, 960.474548, 2097.345703, 1011.022705)) 
{ 
GivePlayerWeapon(playerid, 23, 50); 
SetPlayerSkin(playerid, 180); 
} 
} 
else if (strcmp("/abrir3", cmdtext, true, 10) == 0) 
{ 
if(IsPlayerInRangeOfPoint(playerid, 3.0, 960.474548, 2097.345703, 1011.022705)) 
{ 
GivePlayerWeapon(playerid, 25, 50); 
SetPlayerSkin(playerid, 29); 
}
}
return 1;
}



Respuesta: Commands not working - aalbero99 - 10.07.2015

Not working, its so weird :/


Re: Commands not working - notime - 10.07.2015

This?
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 	if (strcmp("/salir", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 933.206359, 2150.355224, 1011.023437))
    	{
    		SetPlayerPos(playerid, 2530.502197, -1664.375976, 15.166466);
    		SetPlayerInterior(playerid, 0);
		}
		return 1;
	}
 	else if (strcmp("/entrar", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 2530.567871, -1664.283691, 15.166399))
	    {
	        SetPlayerPos(playerid, 933.206359, 2150.355224, 1011.023437);
	        SetPlayerInterior(playerid, 1);
		}
		return 1;
	}
	else if (strcmp("/abrir1", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 960.474548, 2097.345703, 1011.022705))
		{
	        GivePlayerWeapon(playerid, 22, 50);
	        SetPlayerSkin(playerid, 28);
	 	}
	 	return 1;
	}
	else if (strcmp("/abrir2", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 960.474548, 2097.345703, 1011.022705))
	    {
	        GivePlayerWeapon(playerid, 23, 50);
	        SetPlayerSkin(playerid, 180);
		}
		return 1;
	}
	else if (strcmp("/abrir3", cmdtext, true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 960.474548, 2097.345703, 1011.022705))
	    {
	        GivePlayerWeapon(playerid, 25, 50);
	        SetPlayerSkin(playerid, 29);
		}
		return 1;
	}
	return 0;
}
Oh, the copy paste fucked up some tabs, so you gotta make it look pretty again.


Respuesta: Commands not working - aalbero99 - 10.07.2015

Not working either :/ i noticed that the commands from filterscripts work, so i guess the problem is in the code i posted.


Re: Respuesta: Commands not working - notime - 10.07.2015

Quote:
Originally Posted by aalbero99
Посмотреть сообщение
Not working either :/ i noticed that the commands from filterscripts work, so i guess the problem is in the code i posted.
Do me a favour, dont load the filterscripts at all, and try the commands then.


Respuesta: Commands not working - aalbero99 - 10.07.2015

LOL worked now, gonna figure out which filterscript is giving problems, thank you!!


Re: Respuesta: Commands not working - notime - 10.07.2015

Quote:
Originally Posted by aalbero99
Посмотреть сообщение
LOL worked now, gonna figure out which filterscript is giving problems, thank you!!
No problem, Filterscripts will be used first, last its the game mode. So when you do a command, it checks the commands in the FS's first.