about weapon shop
#1

hello guys
i trying to making weapon shop
weapon id (31)
Ammo (player type his ammo from 1bullet to 10000bullet)
money cost (1bullet = 100$ > when he is typing his bullet 10bullet buying it cost 1000$ Etc)
can somone help me please!
+rep
Reply
#2

You trying to make it on CMD or dialogs

also show your codes please.
Reply
#3

Quote:
Originally Posted by LazzyBoy
Посмотреть сообщение
You trying to make it on CMD or dialogs

also show your codes please.
PHP код:
public OnPlayerText(playeridtext[])
{
    if(
text[0] == '1')
    {
        if(
FirstWeaponText[playerid] == 1)
        {
           
//code
        
}
    } 
Reply
#4

Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '1')
    {
        if(FirstWeaponText[playerid] == 1)
        {
		   new Amount;
		   if( sscanf ( params, "d",iAmount))  return SendClientMessage(playerid,-1, "[amount]");// amount he wants.
           if(Amount < 1 || Amount > 10000) return SendClientMessage(playerid,-1,"You can only buy from 1 - 10000 bullets");// check if player has writen more than required
           {
			   GivePlayerMoney(playerid,-Amount*100); // this makes 1 bullet for 100$
			   GivePlayerWeapon(playerid,weapon you want,Amount);// give player weapon
	       }
        }
    }
Should work.
Reply
#5

Quote:
Originally Posted by LazzyBoy
Посмотреть сообщение
Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '1')
    {
        if(FirstWeaponText[playerid] == 1)
        {
		   new Amount;
		   if( sscanf ( params, "d",iAmount))  return SendClientMessage(playerid,-1, "[amount]");// amount he wants.
           if(Amount < 1 || Amount > 10000) return SendClientMessage(playerid,-1,"You can only buy from 1 - 10000 bullets");// check if player has writen more than required
           {
			   GivePlayerMoney(playerid,-Amount*100); // this makes 1 bullet for 100$
			   GivePlayerWeapon(playerid,weapon you want,Amount);// give player weapon
	       }
        }
    }
Should work.
i have error
(377) : error 017: undefined symbol "params"
(381) : error 017: undefined symbol "weapon"
(381) : error 017: undefined symbol "you"
(381) : error 017: undefined symbol "want"
(381) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
[/QUOTE]
Line (377)
PHP код:
           if( sscanf params"d",iAmount))  return SendClientMessage(playerid,-1"[amount]");// amount he wants. 
Line (381)
PHP код:
               GivePlayerWeapon(playerid,weapon you want,Amount);// give player weapon 
Reply
#6

Код:
#include zcmd


GivePlayerWeapon(playerid,31,Amount);
Reply
#7

Quote:
Originally Posted by LazzyBoy
Посмотреть сообщение
Код:
#include zcmd


GivePlayerWeapon(playerid,31,Amount);
i already using zcmd inc
Quote:

(377) : error 017: undefined symbol "params"

PHP код:
if( sscanf params"d",iAmount)) 
Reply
#8

if(sscanf(text[1], ...

If you actually read the error you would've known me lad.
Reply
#9

Quote:
Originally Posted by Freshncool
Посмотреть сообщение
if(sscanf(text[1], ...

If you actually read the error you would've known me lad.
u mean like this ?
PHP код:
if(sscanf(text[0] == '1'
?
Reply
#10

No, I just gave you most of the bloody code.

PHP код:
if( sscanf text[1], "d",iAmount))  return SendClientMessage(playerid,-1"[amount]");// amount he wants. 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)