I need help with command!
#1

Hello I want to make a command, when someone type /takegun will take a 9mm and will remove 100$ from his cash, but when he doesn't have the money he can't take the weapon and will appear a massege on the screen "you don't have enough money" , how I can do this? Please help!!!
Reply
#2

Try lokking at these links, should help you get the desired effect.

https://sampwiki.blast.hk/wiki/OnPlayerCommandText
https://sampwiki.blast.hk/wiki/GetPlayerWeapon
https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
https://sampwiki.blast.hk/wiki/GetPlayerMoney
https://sampwiki.blast.hk/wiki/SendClientMessage
Reply
#3

Amm, take :


Код:
if(strcmp("/takegun", cmdtext, true, 10) == 0)
		{
  			if(IsPlayerConnected(playerid))
         {
          if(GetPlayerMoney(playerid) <= 100) return SendClientMessage(playerid,0xAFAFAFAA, "You don't have enough money!");
          {
       		  SendClientMessage(playerid, 0x9EC73DAA, "You took 9mm.");
              GivePlayerMoney(playerid, -100);
              GivePlayerWeapon(playerid, 22, 80);
           }
          }
         }
EDIT : Haven't tested it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)