SA-MP Forums Archive
Dont Give Weapon - 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: Dont Give Weapon (/showthread.php?tid=498165)



Dont Give Weapon - cr33d - 02.03.2014

Hi, i saw today a good include called mSelection and try to make something.
I've made a preview of some weapon models but there is one problem. When user choose weapon the system dont give him a weapon. Here is the code:
Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
	if(listid == gunlist)
	{
	    if(response)
	    {
		    new string[256];
		    SetPlayerArmedWeapon(playerid,modelid);
     		SendClientMessage(playerid, -1, "Kupili ste oruzije!"); //salje poruku igracu!
     		GivePlayerWeapon(playerid, modelid, 50); //daje oruzije igracu sa 50 metkova
  		 	GivePlayerMoney(playerid, -1000); //uzima novac igracu
  		 	format(string, sizeof(string), "Dragi %s , uspesno ste kupili oruzije!", GetName(playerid));
  		 	SendClientMessage(playerid, -1, string); //salje poruku igracu
	    }
	    else SendClientMessage(playerid, -1, "Odustali ste od kupovine oruzija");
    	return 1;
	}
	return 1;
}
I hope you can help me. Thanks