Jump to content

Question

Posted

Salut, am si eu o problema la speedometru, mai exact textdraw-ul facut de mine apare unde l am pus si nu se modifica viteza si s-a mai pus un speedometru care arata si cand merg pe jos si imi arata viteza cu care merg dar nu in masina si se suprapune pe alt textdraw si nu mai apare celalt textdraw

https://imgur.com/STh0ceU

forward Speed();
public Speed()
{
    new string[50];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerInVehicle(i, GetPlayerVehicleID(i)))
        GetPlayerSpeed(i); 
        format(string, sizeof(string), "~y~Viteza:~g~%d~w~km/h", GetPlayerSpeed(i));
        TextDrawShowForPlayer(i, Text:SPEedometRU[i]);
        PlayerTextDrawSetString(i, PlayerText:SPEedometRU[i], string);
    }
    return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	new string[64];
	if(newstate == PLAYER_STATE_DRIVER)
	{
		format(string, sizeof(string), "~y~Viteza:~g~%d~w~km/h", GetPlayerSpeed(playerid));
		TextDrawSetString(Text:SPEedometRU[playerid], string);
		TextDrawShowForPlayer(playerid, Text:SPEedometRU[playerid]); 
		return 1;
	}
	if(newstate == PLAYER_STATE_ONFOOT)
	{
		TextDrawHideForPlayer(playerid, Text:SPEedometRU[playerid]);
		return 1;
	}
	return 1;
}

 

1 answer to this question

Recommended Posts

  • 0
Posted

e un dezastru codul ala

nu inteleg de ce aici ai 

  TextDrawShowForPlayer(i, Text:SPEedometRU[i]);

si aici ai 

	TextDrawSetString(Text:SPEedometRU[playerid], string);

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.