01.07.2016, 16:52
PHP код:
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;
}
PHP код:
format(string, sizeof(string), "[ 1. %s (%d) ]", GetDrugName(playerid), PlayerInfo[playerid][pDrugAmount][0]);