12.02.2018, 16:19
Quote:
...
you can simply write PHP код:
|
Now, you can learn something new. It's called "switch case" statement (« tutorial here!).
PHP код:
GetTruckNeedTracks(playerid)
{
new truckneedtracks;
new truckskill = GetPlayerTruckSkill(playerid);
if(truckskill == 1) truckneedtracks = 35;
else if(truckskill == 2) truckneedtracks = 100;
else if(truckskill == 3) truckneedtracks = 220;
else if(truckskill == 4) truckneedtracks = 450;
return truckneedtracks;
}
PHP код:
GetTruckNeedTracks(playerid)
{
switch(GetPlayerTruckSkill(playerid))
{
case 1: return 35;
case 2: return 100;
case 3: return 220;
case 4: return 450;
}
return 0;
}