SA-MP Forums Archive
Speedo doesn't stop displaying if player is teleported. - 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: Speedo doesn't stop displaying if player is teleported. (/showthread.php?tid=360362)



Speedo doesn't stop displaying if player is teleported. - Dokins - 17.07.2012

Here is the /tp.

pawn Код:
CMD:tp(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    new giveplayerid;
    if(AdminLevel[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command.");
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /tp [player id or name]");
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOUR_GREY, "That player is not connected.");

    new Float:x, Float: y, Float: z, pinterior;
    GetPlayerPos(playerid, x, y, z);

    pinterior = GetPlayerInterior(playerid);
    SetPlayerPos(giveplayerid, x, y, z);
    SetPlayerInterior(giveplayerid, pinterior);
    new string[128];
    format(string, sizeof(string), "Admin %s has teleported you.", GetNameEx(playerid));
    SendClientMessage(giveplayerid, COLOUR_LIGHTBLUE, string);
    return 1;
}
Speedo check.
pawn Код:
if(GetPlayerState(playerid)!= PLAYER_STATE_DRIVER)
    {
        VehicleSQLID[vehicleid] = MySQL_GetValue(VehicleSQLID[vehicleid], "id", "vehicles");
        MySQL_SetInteger(VehicleSQLID[vehicleid], "VehFuel", VehFuel[vehicleid], "vehicles");
        if(EngineStartStatus[vehicleid] == 0)
        {
            KillTimer(SpeedoSysTimer[playerid]);
            KillTimer(FuelSysTimer[playerid]);
        }
        TextDrawDestroy(enginestring);
        TextDrawHideForPlayer(playerid, enginestring);
        TextDrawHideForPlayer(playerid,speed[playerid]);
        TextDrawHideForPlayer(playerid,fuel[playerid]);
    }
Should I force it to hide?


Re: Speedo doesn't stop displaying if player is teleported. - Ballu Miaa - 17.07.2012

Exactly. You can add it under OnPlayerUpdate that if(GetPlayerState(playerid)!= PLAYER_STATE_ONFOOT) then force to hide all the textdraw's!


Re: Speedo doesn't stop displaying if player is teleported. - Dokins - 17.07.2012

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Exactly. You can add it under OnPlayerUpdate that if(GetPlayerState(playerid)!= PLAYER_STATE_ONFOOT) then force to hide all the textdraw's!
Ahh! OnPlayerUpdate! Makes sense. Thank you very much for your kind reply. + rep.


Re: Speedo doesn't stop displaying if player is teleported. - Ballu Miaa - 18.07.2012

Quote:
Originally Posted by Dokins
Посмотреть сообщение
Ahh! OnPlayerUpdate! Makes sense. Thank you very much for your kind reply. + rep.
All good brother. Thanks for the given rep!