#5

I think you want something like that:

PHP код:
public OnPlayerText(playeridtext[]) 
{  
    if(
FirstWeaponText[playerid] == 1
    { 
        if(!
isNumeric(text))
        {
            
SendClientMessage(playerid,-1"[Enter only digits]");// amount he wants.
            
return 0;
        }
         
        if(
strval(text) < || strval(text) > 10000)
        {
            
SendClientMessage(playerid,-1,"You can only buy from 1 - 10000 bullets");// check if player has writen more than required 
            
return 0;
        }
        
GivePlayerMoney(playerid,-strval(text)*100); // this makes 1 bullet for 100$ 
        
GivePlayerWeapon(playeridWEAPON_M4strval(text)); 
        
FirstWeaponText[playerid] = 0;
        return 
0;
    }
    else
    {
        if(!
strcmp(text"1")) 
        {
            
FirstWeaponText[playerid] = 1;
            
SendClientMessage(playerid, -1"Enter the amount of ammo:");
            return 
0;
        }
    }
    return 
1;

Reply


Messages In This Thread
Help - by astanalol - 06.04.2017, 20:20
Re: Help - by khRamin78 - 06.04.2017, 20:29
Re: Help - by astanalol - 06.04.2017, 20:53
Re: Help - by astanalol - 07.04.2017, 19:38
Re: Help - by XpDeviL - 07.04.2017, 21:01
Re: Help - by astanalol - 07.04.2017, 21:12
Re: Help - by XpDeviL - 07.04.2017, 21:16
Re: Help - by astanalol - 07.04.2017, 21:28

Forum Jump:


Users browsing this thread: 2 Guest(s)