SA-MP Forums Archive
gasup showing for everybody who s gasuping - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: gasup showing for everybody who s gasuping (/showthread.php?tid=422975)



gasup showing for everybody who s gasuping - ancezas - 16.03.2013

pawn Код:
public Gasup(vehicleid,curgass,kof,mokejo,playerid)
{
    if(playerDB[playerid][pila])
    {
    if(GetPlayerMoneyA(playerid) >= kof)
    {
    if(vehicleDB[vehicleid][gas] < aBakai[GetVehicleModel(vehicleid)-400])
    {
    SetTimerEx("Gasup",1000,false,"iiiii",vehicleid,curgass+1,kof,mokejo+kof,playerid);
    vehicleDB[vehicleid][gas]++;
    GivePlayerMoneyA(playerid,-kof);
    new msg[150];
    new degalai[20];
    if(vehicleDB[vehicleid][dujos] == 1) degalai = "Benzin/Dujos";
    else if(vehicleDB[vehicleid][dyzelis] == 1 ) degalai = "Dyzelinas";
    else if(vehicleDB[vehicleid][benzinas] == 1 ) degalai = "Benzinas";
    new model = GetVehicleModel(vehicleid);
    format(msg,156,"~b~Masina:~y~%s~n~~b~Tarifas:~y~%iLT/L~n~~b~Ipilta:~g~%iL~n~~b~Suma:~r~%iLT~n~~b~Kuras:~g~%s~n~~b~Baikti su ~r~Enter",aVehicleNames[model-400],kof,curgass,mokejo,degalai);
    TextDrawSetString(Degaline2, msg);
    TextDrawShowForPlayer(playerid, Degaline1);
    TextDrawShowForPlayer(playerid, Degaline2);
    }else{
    TogglePlayerControllable(playerid,true);
    GameTextForPlayer(playerid,"Bakas pilnas",2000,5);
    playerDB[playerid][pila]=false;
    TextDrawHideForPlayer(playerid, Degaline1);
    TextDrawHideForPlayer(playerid, Degaline2);
    EndGasup(playerid,vehicleid,curgass,kof,mokejo);
    }
    }else{
    TogglePlayerControllable(playerid,true);
    GameTextForPlayer(playerid,"Jums nebeuztenka pinigu",2000,5);
    playerDB[playerid][pila]=false;
    TextDrawHideForPlayer(playerid, Degaline1);
    TextDrawHideForPlayer(playerid, Degaline2);
    EndGasup(playerid,vehicleid,curgass,kof,mokejo);
    }
    }else{
    TogglePlayerControllable(playerid,true);
    EndGasup(playerid,vehicleid,curgass,kof,mokejo);
    }
}
My english is bad but i try to explain, when you gasup your car only you is good, but when two players gasuping theyr cars gasup texdraw showing for both of them, one second mine car's gasup info and the another second his car gasup info, and it reapyting in seconds


Re: gasup showing for everybody who s gasuping - Pottus - 16.03.2013

Use playertextdraws your trying to use one textdraw for two players which is fine when your textdraws don't change position, color, size or text (static or background draws).

You'll need to use these
https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw


Re: gasup showing for everybody who s gasuping - ancezas - 16.03.2013

okay i try it