It's Not Hiding!
#1

I have This Code:
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
	TextDrawHideForPlayer(playerid, speed[playerid]);
	TextDrawDestroy(speed[playerid]);
	return 1;
}
Its Not Hiding that TextDraw
Reply
#2

is it show for 2 times? if not, than use at StateChanges

OnPlayerStateChange >
PHP код:
if(oldstate == PLAYER_STATE_DRIVER)
{
    
TextDrawHideForPlayer(playeridspeed[playerid]);
    
TextDrawDestroy(speed[playerid]);

Reply
#3

Quote:
Originally Posted by Mugalito
Посмотреть сообщение
is it show for 2 times? if not, than use at StateChanges

OnPlayerStateChange >
PHP код:
if(oldstate == PLAYER_STATE_DRIVER)
{
    
TextDrawHideForPlayer(playeridspeed[playerid]);
    
TextDrawDestroy(speed[playerid]);

Not Works
Reply
#4

Of course it won't work he is just posting random code, he doesn't even know what it means.
Reply
#5

Let's assume that you're using player textdraws.

PHP код:
public OnPlayerExitVehicle(playeridvehicleid)
{
    
PlayerTextDrawHide(playeridspeed[playerid]);
    
PlayerTextDrawDestroy(playeridspeed[playerid]);
    return 
1;

If not. Then you're probably trying to hiding the wrong textdraw.
Reply
#6

My Code:
PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    
speed[playerid] = TextDrawCreate(500373"SPEED:");
    
TextDrawUseBox(speed[playerid], 0);
    
TextDrawFont(speed[playerid], 3);
    
TextDrawBoxColor(speed[playerid], 0x252826FF);
    
format(strsizeof(str), "SPEED:~y~%i"GetPlayerVehicleSpeed(playerid));
    
TextDrawSetString(speed[playerid], str);
    
TextDrawShowForPlayer(playeridspeed[playerid]);
    
SetTimer("speedtime",10000);
    
/////////////////////////////////////
    
return 1;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
        
TextDrawDestroy(speed[playerid]);
    
TextDrawHideForPlayer(playeridspeed[playerid]);
    return 
1;

Reply
#7

Quote:
Originally Posted by Osamakurdi
Посмотреть сообщение
My Code:
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	speed[playerid] = TextDrawCreate(500, 373, "SPEED:");
	TextDrawUseBox(speed[playerid], 0);
	TextDrawFont(speed[playerid], 3);
	TextDrawBoxColor(speed[playerid], 0x252826FF);
	format(str, sizeof(str), "SPEED:~y~%i", GetPlayerVehicleSpeed(playerid));
	TextDrawSetString(speed[playerid], str);
	TextDrawShowForPlayer(playerid, speed[playerid]);
	SetTimer("speedtime",1000, 0);
	/////////////////////////////////////

	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
        TextDrawDestroy(speed[playerid]);
	TextDrawHideForPlayer(playerid, speed[playerid]);
	return 1;
}
Post the code of (new Text: ) too
Reply
#8

Quote:
Originally Posted by willbedie
Посмотреть сообщение
Post the code of (new Text: ) too
PHP код:
new Text:speed[MAX_PLAYERS];
new 
str[180]; 
Reply
#9

Quote:
Originally Posted by Osamakurdi
Посмотреть сообщение
My Code:
PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    
speed[playerid] = TextDrawCreate(500373"SPEED:");
    
TextDrawUseBox(speed[playerid], 0);
    
TextDrawFont(speed[playerid], 3);
    
TextDrawBoxColor(speed[playerid], 0x252826FF);
    
format(strsizeof(str), "SPEED:~y~%i"GetPlayerVehicleSpeed(playerid));
    
TextDrawSetString(speed[playerid], str);
    
TextDrawShowForPlayer(playeridspeed[playerid]);
    
SetTimer("speedtime",10000);
    
/////////////////////////////////////
    
return 1;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
        
TextDrawDestroy(speed[playerid]);
    
TextDrawHideForPlayer(playeridspeed[playerid]);
    return 
1;

Your code is really bad, for instance, Per-Player textdraws should be used to do stuff like these.

Please look up a speedometer tutorial on the forums.
Reply
#10

Quote:
Originally Posted by willbedie
Посмотреть сообщение
Of course it won't work he is just posting random code, he doesn't even know what it means.
stop sh<3tting about me, I'm trying to help them for nothing, not even rep or some sh**es like this, this guy creates a textdraw at > OnPlayerEnterVehicle, player can avoid to dont enter vehicle after this callback is called, so textdraw is already created and its totally dumbness, I ask him to write code in OnPlayerStateChange and now u made a sh** on me, thank you very much.
and I know what I'm telling to him and what does it means.
main problem there was looping, I didnt asked for the more codes yet, cuz we have to make our job step-by-step.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)