View Single Post
Old 12/02/2018, 02:30 PM   #747
PepsiCola23
Gangsta
 
Join Date: May 2015
Posts: 684
Reputation: 3
Default Re: Today I learned - Share your newly found knowledge!

today i learned that there is not necessary to use
PHP Code:
stock 
in your gamemode.

for example,instead of
PHP Code:
stock GetTruckNeedTracks(playerid)
{
    new 
truckneedtracks;
    new 
truckskill GetPlayerTruckSkill(playerid);
    if(
truckskill == 1truckneedtracks 35;
    else if(
truckskill == 2truckneedtracks 100;
    else if(
truckskill == 3truckneedtracks 220;
    else if(
truckskill == 4truckneedtracks 450;
    return 
truckneedtracks;

you can simply write
PHP Code:
GetTruckNeedTracks(playerid)
{
    new 
truckneedtracks;
    new 
truckskill GetPlayerTruckSkill(playerid);
    if(
truckskill == 1truckneedtracks 35;
    else if(
truckskill == 2truckneedtracks 100;
    else if(
truckskill == 3truckneedtracks 220;
    else if(
truckskill == 4truckneedtracks 450;
    return 
truckneedtracks;

PepsiCola23 is offline   Reply With Quote