Quote:
Originally Posted by brauf
Took me a while to figure out but...
PHP Code:
new TotalDrugs[MAX_PLAYERS];
CMD:drugs(playerid, params[])
{
TotalDrugs[playerid] = Player[playerid][MarijuanaGrams] + Player[playerid][CocaineGrams];
printf("total drugs %i", TotalDrugs[playerid]);
return 1;
}
|
I wouldn't use a global variable, define it locally unless you're using it in multiple places.