SA-MP Forums Archive
Gun shop help :/ - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Gun shop help :/ (/showthread.php?tid=229366)



Gun shop help :/ - Randomai - 21.02.2011

I have no idea how to make gunshop.

I just want Red checkpoint / marker to outside of Los Santos police department, where you can buy weapons.

here is "cordinates" where i would like to have it:

Код:
AddPlayerClass(281,1568.5647,-1693.0901,5.8906,183.4294,0,0,0,0,0,0); // "GUNSHOP"
if anyone can help me, making the code?here is bit start, all i could figure myself.


Код:
if(PlayerTeam[playerid] == 0)
	           {
	                SendClientMessage(playerid, COLOR_GREEN, "|_| Last Weapons Of Los Santos |_|");
		        SendClientMessage(playerid, WHITE, "/Desert Eagle Price: $1000");
		    	SendClientMessage(playerid, WHITE, "/M4 Rifle Price: $2500");
		    	SendClientMessage(playerid, WHITE, "/AK-47 Rifle Price: $2000");
		    	SendClientMessage(playerid, WHITE, "/Sniper Rifle Price: $3000");
		    	SendClientMessage(playerid, WHITE, "/Molotov Price: $1000");
                   }
	           else
	           {
		   SendClientMessage(playerid, COLOR_RED, "Brains....No brains heeere....");
    	           }



Re: Gun shop help :/ - 77ther - 21.02.2011

Код:
if(strcmp(cmd, "/deserteagle", true) == 0)
	{
		if(IsPlayerConnected(playerid))
       	{
			if(IsPlayerInRangeOfPoint(playerid, 3,250.0484,66.2467,1003.6406)) // you set coords where you should be to initiate this cmd
          	{
   				if(GetPlayerMoney(playerid) < 1000)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for Desert Eagle");
					        return 1;
                        }
					    else
					    {
	             			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought Desert Eagle for 1000$");
	             			SafeGivePlayerMoney(playerid, - 1000);
	             			SafeGivePlayerWeapon(playerid, 24, 100); // 24 is gun ID of deagle, you can find them all on samp wiki, 100 is ammo
						}
			}
		}
		return 1;
	}
Edit: Bracklets "{" and "}" got little bit fucked up, just move them on correct place


Re: Gun shop help :/ - Randomai - 21.02.2011

i edited code bit, because there was errors.Cant see red checkpoint anywhere.not working at all



Код:
    if(strcmp(cmdtext, "/deserteagle", true) == 0)
	{
		if(IsPlayerConnected(playerid))
       	{
			if(IsPlayerInRangeOfPoint(playerid, 1568.5647,-1693.0901,5.8906,183.4294)) // you set coords where you should be to initiate this cmd
          	{
   				if(GetPlayerMoney(playerid) < 1000)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for Desert Eagle");
					        return 1;
                        }
					    else
					    {
	             			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought Desert Eagle for 1000$");
	             			GivePlayerMoney(playerid, - 1000);
	             			GivePlayerWeapon(playerid, 24, 100); // 24 is gun ID of deagle, you can find them all on samp wiki, 100 is ammo
						}
			    }
		}
		return 1;
	}



Re: Gun shop help :/ - 77ther - 21.02.2011

it's because I didn't create that checkpoint, just find on samp wiki creating checkpoint, and put that coords here..