Help with stock function
#1

I am trying to make drug system, but I have problem with stock... GetDrugName function won't show drug name...

Код HTML:
stock GetDrugName ( playerid ) {
   new drugname [ 30 ];
   for( new slot = 0; slot != 12; slot++ )
   {
      if ( PlayerInfo [ playerid ] [ pDrug ] [ slot ] == 1 ) { drugname = "Marijuana"; }
      if ( PlayerInfo [ playerid ] [ pDrug ] [ slot ] == 2 ) { drugname = "Cocaine"; }
      if ( PlayerInfo [ playerid ] [ pDrug ] [ slot ] == 3 ) { drugname = "Heroine"; }
   }
   return drugname;
}
Код HTML:
format(string, sizeof(string), "[ 1. %s (%d) ]", GetDrugName(PlayerInfo [ playerid ] [ pDrug ] [ 0]), PlayerInfo[playerid][pDrugAmount][0]);
So when you use /mydrugs it will show you [1 . (100) ] (for example)
Reply


Messages In This Thread
Help with stock function - by nemanjasepa - 30.06.2016, 07:58
Re: Help with stock function - by Vince - 30.06.2016, 08:49
Re: Help with stock function - by nemanjasepa - 30.06.2016, 08:50
Re: Help with stock function - by nemanjasepa - 30.06.2016, 09:06
Re: Help with stock function - by Vince - 30.06.2016, 09:23
Re: Help with stock function - by nemanjasepa - 30.06.2016, 09:49
Re: Help with stock function - by nemanjasepa - 01.07.2016, 15:33
Re: Help with stock function - by SyS - 01.07.2016, 16:52
Re: Help with stock function - by nemanjasepa - 01.07.2016, 19:11
Re: Help with stock function - by jlalt - 01.07.2016, 19:26

Forum Jump:


Users browsing this thread: 1 Guest(s)