30.06.2016, 07:58
I am trying to make drug system, but I have problem with stock... GetDrugName function won't show drug name...
So when you use /mydrugs it will show you [1 . (100) ] (for example)
Код 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]);