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=325523)



Commands not working. - Jack.7331 - 13.03.2012

So, recently I added some commands to my script, pawno compiled them fine and I uploaded them and it says "Unknown command".
If you could help me, that'd be awesome.
Код:
CMD:knife(playerid, params[]) {
	if(playerVariables[playerid][pGroup] == 10);
	SpawnPlayerWeapon(playerid, 4, 1);
	}
	return 1;
}
CMD:resetbook(playerid, params[]) {
  if(playerVariables[playerid][pPhoneBook] == 1};
  playerVariables[playerid][pPhoneBook] == 1;
  return 1;
}
CMD:requestevent(playerid, params[]) {
		if(playerVariables[playerid][pAdminLevel] >= 3;
		SendClientMessage(playerid, COLOUR_ORANGE, "%d has requested an event, /pm them to find out more information.", playerid);
   }
}
I'm using vortex roleplay 2, and I've added it to the bottom of the script.
I'm also a newb to pawno...so..


Re: Commands not working. - [ABK]Antonio - 13.03.2012

pawn Код:
CMD:knife(playerid, params[])
{
    if(playerVariables[playerid][pGroup] == 10) SpawnPlayerWeapon(playerid, 4, 1);
    return 1;
}
CMD:resetbook(playerid, params[])
{
    if(playerVariables[playerid][pPhoneBook] == 1) playerVariables[playerid][pPhoneBook] = 0; //I suspect you want to set it to 0 instead of 1
    return 1;
}
CMD:requestevent(playerid, params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 3)
    {
        new string[128];
        format(string, sizeof(string), "%d has requested an event, /pm them to find out more information.", playerid);
        SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    return 1;
}
https://sampwiki.blast.hk/wiki/Control_Structures#if


Re: Commands not working. - Jack.7331 - 13.03.2012

I've tried that, but it still isn't working?


Re: Commands not working. - John Rockie - 13.03.2012

Do you have CMD and OnPlayerCommandText?


Re: Commands not working. - Jack.7331 - 13.03.2012

Er, what do you mean?
VX-RP commands run like,
CMD:
I initially did OnPlayerCommandText, but then I converted it, realising it may not work because the rest was CMD:


Re: Commands not working. - Jack.7331 - 13.03.2012

Help?


Re: Commands not working. - FalconX - 13.03.2012

Quote:
Originally Posted by Jack.7331
Посмотреть сообщение
Help?
Make sure you don't use strcmp commands with Zcmd. It get's conflict and the command do not work. Check if you have OnPlayerCommandText, remove the whole callback, include Zcmd and compile, I am sure you are doing something wrong, check and I am sure it will work.

-FalconX


Re: Commands not working. - Jack.7331 - 14.03.2012

None of those.
I'm using VX-RP, which uses Zcmd. I can't find any "OnPlayerCommandText" either?