SA-MP Forums Archive
about a gun buying command - 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: about a gun buying command (/showthread.php?tid=74389)



about a gun buying command - WardenCS - 22.04.2009

hello i found a command from forum,how i can make it like i can buy it only in ammunations?
code is here


Quote:

if (strcmp(cmdtext, "/desert", true)==0)
{
if(GetPlayerMoney(playerid) > 1999){
GivePlayerMoney(playerid, -2000);
GivePlayerWeapon(playerid,24,800);
SendClientMessage(playerid,GRAY,"Enjoy!");
new desert[MAX_PLAYER_NAME];
GetPlayerName(playerid, desert, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s buy a desert eagle - /weapons", desert);
SendClientMessageToAll(GRAY, string);
}
else{
SendClientMessage(playerid,RED,"You dont have money!");
}
return 1;
}




Re: about a gun buying command - Think - 22.04.2009

Quote:
Originally Posted by WardenCS
hello i found a command from forum,how i can make it like i can buy it only in ammunations?
code is here


Quote:

if (strcmp(cmdtext, "/desert", true)==0)
{
if(GetPlayerMoney(playerid) > 1999){
GivePlayerMoney(playerid, -2000);
GivePlayerWeapon(playerid,24,800);
SendClientMessage(playerid,GRAY,"Enjoy!");
new desert[MAX_PLAYER_NAME];
GetPlayerName(playerid, desert, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s buy a desert eagle - /weapons", desert);
SendClientMessageToAll(GRAY, string);
}
else{
SendClientMessage(playerid,RED,"You dont have money!");
}
return 1;
}

PlayerToPoint


Re: about a gun buying command - WardenCS - 22.04.2009

where i add it?
please make it to me,i got coordinates
AddPlayerClass(113,290.1963,-109.7823,1001.5156,177.9606,0,0,0,0,0,0); // ammuthingy


Re: about a gun buying command - Think - 22.04.2009

http://pandabeer1337.pastebin.com/d5e16b101


NOTE!

change if(!PlayerToPoint(playerid, 5.0, 290.1963,-109.7823,1001.5156)) {
into

if(!PlayerToPoint(5.0, playerid, 290.1963,-109.7823,1001.5156)) {


Re: about a gun buying command - MenaceX^ - 22.04.2009

Panda, PlayerToPoint doesn't have to be a public...
It's useless, I prefer make it as stock..

btw, same cmd with a fixed identitation.
pawn Код:
if(!strcmp(cmdtext,"/desert",true))
{
  if(!PlayerToPoint(playerid, 5.0, 290.1963,-109.7823,1001.5156))
    return SendClientMessage(playerid, COLOR_RED, "Your not in the ammunation");
  if(GetPlayerMoney(playerid) < 1999)
    return SendClientMessage(playerid,COLOR_RED,"You don't have enough money.");
  GivePlayerMoney(playerid, -2000);
  GivePlayerWeapon(playerid,24,800);
  SendClientMessage(playerid,GRAY,"Enjoy!");
  new desert[MAX_PLAYER_NAME];
  GetPlayerName(playerid, desert, MAX_PLAYER_NAME);
  format(string, sizeof(string), "%s bought a desert eagle - /weapons", desert);
  SendClientMessageToAll(GRAY, string);
  return 1;
}



Re: about a gun buying command - WardenCS - 22.04.2009

YOUR NOT IN AMMUNATION:S


Re: about a gun buying command - WardenCS - 22.04.2009

sry for double post but help me..