Help with stock function
#10

this supposed to work
PHP код:
GetDrugName(playeridslotID) {
   new 
drugname [30];
   switch(
PlayerInfo playerid ] [ pDrug ] [ slotID ]) {
      case 
1: {
          
drugname "Marijuana";
      }
      case 
2: {
          
drugname "Cocaine";
      }
      case 
3: {
          
drugname "Heroine";
      }
      default: {
          
drugname "-255";
      }
   }
   return 
drugname;

Usage:
GetDrugName(playerid, slotID);

example:
PHP код:
public OnPlayerConnect(playerid) {
   new 
string[128];
   for( new 
slot 0slot 13slot++ ) {
      new 
drugname[30];
      
drugname GetDrugName(playeridslot);
      if(
strval(drugname) != -255) {
          
format(stringsizeof(string), "%s[ %d. %s (%d) ], ",stringslot+1GetDrugName(playeridslot), PlayerInfo[playerid][pDrugAmount][slot]);
      }
   }

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)