03.02.2009, 09:22
Hello again in my second tutorial. I'll show you how to make simple gunshop anywhere (you just need coordinates where).
Let's start.
First of all you need PlayerToPoint definition. Paste that on bottom of your script.
Under line OnPlayerCommandText(playerid, cmdtext[]) (where you put commands for player).
You can add under GivePlayerWeapon like GivePlayerMoney(playerid, -1000); That will take 1000 $ from player. You can add SendClientMessage(playerid, white, "You bought desert eagle"); That will write You bought desert eagle when he types /deagle.
That is my another tutorial. Thanks for reading. PlayDead
Let's start.
First of all you need PlayerToPoint definition. Paste that on bottom of your script.
Код:
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z) { new Float:oldposx, Float:oldposy, Float:oldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } return 0; }
Код:
if (strcmp(cmdtext, "/deagle", true) == 0) { if(PlayerToPoint(10, playerid, coordinates from gunshop)) { GivePlayerWeapon(playerid, 24, 100); // 24 is desert eagle, 100 is ammo return 1; } return 1; }
That is my another tutorial. Thanks for reading. PlayDead