SA-MP Forums Archive
Cmds won't work.. - 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: Cmds won't work.. (/showthread.php?tid=327588)



Cmds won't work.. - Mr.Lauren - 21.03.2012

Hello everyone..when I use the /"cmds here" it just won't do any actions ig.
Let's say my shop..
Код:
	if (strcmp("/shop", cmdtext, true) )
	{
	   SendClientMessage(playerid, COLOR_DARKPURPLE , "Wellcome to the shop, you can buy the next items. Use /WEAPON, exc. /ak47.");
	   SendClientMessage(playerid, COLOR_DARKPURPLE , "The list of the following weapons is, /ak47,/mp5,/deagle,/sniper,/grenades,/spas12,/tec9,/shawn,/uzi..");
	   SendClientMessage(playerid, COLOR_DARKPURPLE , "Ak47/M4 - 1500$, Mp5 - 1000$, Deagle - 750$");
	   SendClientMessage(playerid, COLOR_DARKPURPLE , "Sniper - 2000$, Grenades - 5000$, Combat-Shotgun - 2500$");
	   SendClientMessage(playerid, COLOR_DARKPURPLE , "Tec-9 - 1500$, Shawn-off - 3000$, Uzi - 1500$");
	   return 1;
	}
	
	if (strcmp("/ak47", cmdtext, true) )
	{
	  GivePlayerWeapon(playerid, 30, 5000);
	  GivePlayerMoney(playerid, -1500);
	  SendClientMessage(playerid, COLOR_RED , "You have just purchased a brand new Ak-47!");
	  return 1;
	}
	
	if (strcmp("/mp5", cmdtext, true) )
	{
	  GivePlayerWeapon(playerid, 29, 5000);
	  GivePlayerMoney(playerid, -1000);
	  SendClientMessage(playerid, COLOR_RED , "You have just purchased a brand new Mp5!");
	  return 1;
	}
	
	if (strcmp("/deagle", cmdtext, true) )
	{
	  GivePlayerWeapon(playerid, 24, 5000);
	  GivePlayerMoney(playerid, -750);
	  SendClientMessage(playerid, COLOR_RED , "You have just purchased a brand new Deagle!");
	  return 1;
	}
	
	if (strcmp("/sniper", cmdtext, true) )
	{
	  GivePlayerWeapon(playerid, 34, 500);
	  GivePlayerMoney(playerid, -2000);
	  SendClientMessage(playerid, COLOR_RED , "You have just purchased a brand new Sniper!");
	  return 1;
	}
	
	if (strcmp("/grenades", cmdtext, true) )
	{
	  GivePlayerWeapon(playerid, 16, 20);
	  GivePlayerMoney(playerid, -5000);
	  SendClientMessage(playerid, COLOR_RED , "You have just purchased some grenades!");
	  return 1;
	}
	
	if (strcmp("/spas12", cmdtext, true) )
	{
	  GivePlayerWeapon(playerid, 27, 5000);
	  GivePlayerMoney(playerid, -2500);
	  SendClientMessage(playerid, COLOR_RED , "You have just purchased a brand new Combat Shotgun!");
	  return 1;
	}
	
	if (strcmp("/tec9", cmdtext, true) )
	{
	  GivePlayerWeapon(playerid, 32, 5000);
	  GivePlayerMoney(playerid, -1500);
	  SendClientMessage(playerid, COLOR_RED , "You have just purchased a brand new Tec-9!");
	  return 1;
	}
	
	if (strcmp("/shawn", cmdtext, true) )
	{
	  GivePlayerWeapon(playerid, 26, 400);
	  GivePlayerMoney(playerid, -3000);
	  SendClientMessage(playerid, COLOR_RED , "You have just purchased a brand new Shawn-off Shotgun!");
	  return 1;
	}
	
	if (strcmp("/uzi", cmdtext, true) )
	{
	   GivePlayerWeapon(playerid, 28, 5000);
	   GivePlayerMoney(playerid, -1500);
	   SendClientMessage(playerid, COLOR_RED , "You have just pruchased a brand new Uzi!");
	   return 1;
	}
Did I miss something? How to make it actually do an action?


Re: Cmds won't work.. - Joshb93 - 21.03.2012

Example(should look like this):

pawn Код:
if(strcmp("/shop", cmdtext, true) == 0)
That needs to be the same for all. Let me know if this helps.


Re: Cmds won't work.. - Mr.Lauren - 21.03.2012

I did it, but it still didn't help, I went ig, but the cmds won't work..


Re: Cmds won't work.. - Bogdan1992 - 21.03.2012

Question, did you restart the server?


Re: Cmds won't work.. - Joshb93 - 21.03.2012

Quote:
Originally Posted by Bogdan1992
Посмотреть сообщение
Question, did you restart the server?
Lol, it amuses me when people do this, they freak out because they cant get it to work after compiling it, and come to find out, they never restarted their server.


Re: Cmds won't work.. - Mr.Lauren - 21.03.2012

Well, I actually did restart and gmx, but it still won't work, maybe its something with #defines or something...
Can anyone help me?