about a gun buying command
#1

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;
}

Reply
#2

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
Reply
#3

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
Reply
#4

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)) {
Reply
#5

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;
}
Reply
#6

YOUR NOT IN AMMUNATION:S
Reply
#7

sry for double post but help me..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)