Jump to content
  • 0

3dSpeedometer


ionutuidumanu

Question

Am un fs cu 3dspedometer vreau cand ies din masina sa dispara ca imi ramane acolo pe masina pana iau alta

Poftim liniile

public OnFilterScriptInit() { Speedoff = SetTimer("Speed", 500, 1); return 1; }

forward Speed();

public Speed()

{

for(new p = 0; p < GetMaxPlayers(); p++) if(IsPlayerConnected(p) && !IsPlayerNPC(p))

{

new vehicleid = GetPlayerVehicleID(p);

if(vehicleid)

{

        new string[128], Float:X, Float:Y, Float:Z, Float:PointToPoint, Float:vhealth;

        GetVehicleVelocity(vehicleid, X, Y, Z);

        PointToPoint = (floatsqroot(floatpower(X, 2) + floatpower(Y, 2) + floatpower(Z, 2)))*100;

GetVehicleHealth(vehicleid,vhealth);

format(string,sizeof string ,"{F81414}Masina: %s\n{F3FF02}Rezistenta: %.2f\n{0049FF}Viteza: %ikm/h", VehicleName[GetVehicleModel(vehicleid)-400], vhealth, floatround(PointToPoint, floatround_floor));

DeletePlayer3DTextLabel(p, speedo3Dtext);

    speedo3Dtext = CreatePlayer3DTextLabel(p, string, speedcolor, 0.0,-1.6,-0.35,20.0, INVALID_PLAYER_ID, vehicleid);

} else if(p) { DeletePlayer3DTextLabel(p, speedo3Dtext); }

}

}

The Legend

Link to comment
Share on other sites

21 answers to this question

Recommended Posts

@heker dc  i?...daca DeletePlayer3DTextLabel are parametrii (playerid, sppedoname);??

sau daca pune i...cea ce ii si necesar...trebuie mai intai as pun si for( new i; i < i MAX_PLAYER, etc) -  scz dar nu sunt akasa akm si nu stiu loop-ul pe derost..

Fara reclama in semnatura!

Link to comment
Share on other sites

DeletePlayer3DTextLabel( playerid, speedo3Dtext );

daca nu incerca

DeletePlayer3DTextLabel( i, speedo3Dtext );

xD


@heker dc  i?...daca DeletePlayer3DTextLabel are parametrii (playerid, sppedoname);??

sau daca pune i...cea ce ii si necesar...trebuie mai intai as pun si for( new i; i < i MAX_PLAYER, etc) -  scz dar nu sunt akasa akm si nu stiu loop-ul pe derost..


Ma voi sunteti nebuni aman2, daca face cum ati zis voi va sterge 3DText-ul la Toti Playeri care sunt in Vehicule, si el vrea numai pentru el cand Iese...

142sj0l.png

Underground-GFX

Link to comment
Share on other sites

Te rog fami tu ai asa ca mie imi da eroare asta

C:\Documents and Settings\All Users\Documents\In Lucru\Best\Server RCD\filterscripts\speedo.pwn(52) : error 017: undefined symbol "i"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.

Ai ce am eu in spedometer mai sus

The Legend

Link to comment
Share on other sites

Am pus dar dispare o secunda si apare iar..

new PlayerText3D:speedo3Dtext;

new Speedoff;

public OnFilterScriptInit() { Speedoff = SetTimer("Speed", 500, 1); return 1;

}

public OnPlayerExitVehicle(playerid, vehicleid)

{

DeletePlayer3DTextLabel( playerid, speedo3Dtext );

return 1;

}

forward Speed();

public Speed()

{

for(new p = 0; p < GetMaxPlayers(); p++) if(IsPlayerConnected(p) && !IsPlayerNPC(p))

{

new vehicleid = GetPlayerVehicleID(p);

if(vehicleid)

{

        new string[128], Float:X, Float:Y, Float:Z, Float:PointToPoint, Float:vhealth;

        GetVehicleVelocity(vehicleid, X, Y, Z);

        PointToPoint = (floatsqroot(floatpower(X, 2) + floatpower(Y, 2) + floatpower(Z, 2)))*100;

GetVehicleHealth(vehicleid,vhealth);

format(string,sizeof string ,"{F81414}Masina: %s\n{F3FF02}Rezistenta: %.2f\n{0049FF}Viteza: %ikm/h", VehicleName[GetVehicleModel(vehicleid)-400], vhealth, floatround(PointToPoint, floatround_floor));

DeletePlayer3DTextLabel(p, speedo3Dtext );

    speedo3Dtext = CreatePlayer3DTextLabel(p, string, speedcolor, 0.0,-1.6,-0.35,20.0, INVALID_PLAYER_ID, vehicleid);

} else if(p) { DeletePlayer3DTextLabel(p, speedo3Dtext); }

}

}

public OnFilterScriptExit() { KillTimer(Speedoff); for(new p = 0; p < GetMaxPlayers(); p++) DeletePlayer3DTextLabel(p, speedo3Dtext); return 1; }

The Legend

Link to comment
Share on other sites

Deci, heker, esti praf, noroc cu banii, ca nu luai moderator aici in veci, i != playerid, i se face din script, de obicei pentru toti playerii,

for( new i; i < MAX_PLAYERS; i ++ )
{
    //script pentru i
}
Daca nu stii nu te baga. @ionutuidumanu tu s-ar putea sa ai
public OnPlayerExitVehicle( vehicleid )
tu trebuie s-o inlocuiesti cu
public OnPlayerExitVehicle( playerid, vehicleid )
si dupa { trebuie sa adaugi ce a zis Roach,
DeletePlayer3DTextLabel( playerid, speedo3Dtext );

Roach (postul dinaintea mea): ala ar distruge speedometerul tuturor, deci sa nu-l adauge !

Link to comment
Share on other sites

Da lam pus dispare cand ies din masina dar dupa ce ma urc iar in masina nu mai apare,stuntman eu nu aveam deloc public OnPlayerExitVehicle(playerid, vehicleid)  sau public OnPlayerExitVehicle( vehicleid) lam adaugat eu

Uite doar asta are fs inafar de masini:

new PlayerText3D:speedo3Dtext;

new Speedoff;

public OnFilterScriptInit() { Speedoff = SetTimer("Speed", 500, 1); return 1; }

forward Speed();

public Speed()

{

for(new p = 0; p < GetMaxPlayers(); p++) if(IsPlayerConnected(p) && !IsPlayerNPC(p))

{

new vehicleid = GetPlayerVehicleID(p);

if(vehicleid)

{

        new string[128], Float:X, Float:Y, Float:Z, Float:PointToPoint, Float:vhealth;

        GetVehicleVelocity(vehicleid, X, Y, Z);

        PointToPoint = (floatsqroot(floatpower(X, 2) + floatpower(Y, 2) + floatpower(Z, 2)))*100;

GetVehicleHealth(vehicleid,vhealth);

format(string,sizeof string ,"{F81414}Masina: %s\n{F3FF02}Rezistenta: %.2f\n{0049FF}Viteza: %ikm/h", VehicleName[GetVehicleModel(vehicleid)-400], vhealth, floatround(PointToPoint, floatround_floor));

DeletePlayer3DTextLabel(p, speedo3Dtext);

    speedo3Dtext = CreatePlayer3DTextLabel(p, string, speedcolor, 0.0,-1.6,-0.35,20.0, INVALID_PLAYER_ID, vehicleid);

} else if(p) { DeletePlayer3DTextLabel(p, speedo3Dtext); }

}

}

public OnFilterScriptExit() { KillTimer(Speedoff); for(new p = 0; p < GetMaxPlayers(); p++) DeletePlayer3DTextLabel(p, speedo3Dtext); return 1; }

The Legend

Link to comment
Share on other sites

Inlocuieste tot cu asta

new PlayerText3D:speedo3Dtext;
new Speedoff;

public OnFilterScriptInit() { Speedoff = SetTimer("Speed", 500, 1); return 1; }

forward Speed();
public Speed()
{
	for(new p = 0; p < GetMaxPlayers(); p++) if(IsPlayerConnected(p) && !IsPlayerNPC(p))
	{
		new vehicleid = GetPlayerVehicleID(p);
		if(vehicleid)
		{
	        new string[128], Float:X, Float:Y, Float:Z, Float:PointToPoint, Float:vhealth;
         	GetVehicleVelocity(vehicleid, X, Y, Z);
         	PointToPoint = (floatsqroot(floatpower(X, 2) + floatpower(Y, 2) + floatpower(Z, 2)))*100;
			GetVehicleHealth(vehicleid,vhealth);
			format(string,sizeof string ,"Masina: %s\nRezistenta: %.2f\nViteza: %ikm/h", VehicleName[GetVehicleModel(vehicleid)-400], vhealth, floatround(PointToPoint, floatround_floor));
			DeletePlayer3DTextLabel(p, speedo3Dtext);
	    	speedo3Dtext = CreatePlayer3DTextLabel(p, string, speedcolor, 0.0,-1.6,-0.35,20.0, INVALID_PLAYER_ID, vehicleid);
		} else if(p) { DeletePlayer3DTextLabel(p, speedo3Dtext); }
	}
}

public OnFilterScriptExit() { KillTimer(Speedoff); for(new p = 0; p < GetMaxPlayers(); p++) DeletePlayer3DTextLabel(p, speedo3Dtext); return 1; }

Samp.OnlyPro.ro - RolePlay - Join Us !

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.