Make a total
#4

Quote:
Originally Posted by brauf
View Post
Took me a while to figure out but...

PHP Code:
new TotalDrugs[MAX_PLAYERS];
CMD:drugs(playeridparams[])
{
   
    
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.
Reply


Messages In This Thread
Make a total - by KinderClans - 15.08.2018, 19:15
Re: Make a total - by brauf - 15.08.2018, 19:28
Re: Make a total - by iLearner - 15.08.2018, 19:32
Re: Make a total - by BornHuman - 15.08.2018, 19:33
Re: Make a total - by brauf - 15.08.2018, 19:34
Re: Make a total - by BornHuman - 15.08.2018, 19:45
Re: Make a total - by iLearner - 15.08.2018, 21:12

Forum Jump:


Users browsing this thread: 1 Guest(s)