25.03.2011, 11:44
Fiz o tutorial certinho mas os valores no jogo nгo alteram...
WARNING
Poderiam me ajudar ?
pawn Код:
#include <a_samp>
new fuel[MAX_VEHICLES]; //fuel per vehicle
forward timer_fuel_lower(); //timer for lowering the fuel value
forward timer_refuel(playerid); //timer to refuel vehicle
new isrefuelling[MAX_PLAYERS] = 0; //bool to check if player is already refuelling
new Text:td_fuel[MAX_PLAYERS]; //textdraw with fuel
public OnFilterScriptInit() {
for(new i=0;i<MAX_VEHICLES;i++) {
fuel[i] = 100; //sets every car's fuel to 100 in a loop
}
SetTimer("timer_fuel_lower",4200,true); //sets the timer to drop the fuel
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate) {
if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
new vid = GetPlayerVehicleID(playerid);
new string[125];format(string,sizeof string,"Gasolina:100",fuel[vid]); //quickly doing a small update on fuel (so it wont jump from 100 to its real value)
TextDrawSetString(td_fuel[playerid],string);
TextDrawShowForPlayer(playerid,td_fuel[playerid]); //showing if an player is a driver or passenger of the ar
}
else
{
TextDrawHideForPlayer(playerid,td_fuel[playerid]); //hiding if a player isnt driving/or an passenger
}
return 1;
}
public OnPlayerSpawn(playerid)
{
td_fuel[playerid] = TextDrawCreate(45,324,"Gasolina:%i"); //create the textdraw at position
TextDrawBackgroundColor(td_fuel[playerid],0x00000033); //setting an nice backgroundcolor
TextDrawFont(td_fuel[playerid],3); //font type of textdraw
TextDrawLetterSize(td_fuel[playerid],0.699999,1.700000); //size...
TextDrawColor(td_fuel[playerid],0x000000ff); //color
TextDrawSetShadow(td_fuel[playerid],3); //dropping the shadow
return 1;
}
WARNING
Код:
C:\Users\GABRIEL\Desktop\LifeisGood\filterscripts\Fuel.pwn(40) : warning 203: symbol is never used: "isrefuelling" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.