Jump to content

Question

Posted

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

21 answers to this question

Recommended Posts

Posted

pai posteaza aici scriptul noi de unde sa stiim ce ai facut tu acolo

PS trebuie sa faci ceva la public OnPlayerExitVehicle

<a href=http://devilone.ro>

devilone-banner.png</a>

Posted

Adauga la public OnPlayerExitVehicle:

DeletePlayer3DTextLabel( playerid, speedo3Dtext );

EDIT: Al 600-lea Post al meu...

142sj0l.png

Underground-GFX

Posted

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

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.

The Legend

Posted

public OnPlayerExitVehicle( playerid, vehicleid )

{

DeletePlayer3DTextLabel( playerid, speedo3Dtext );

return ( 1 );

}


Este imposibil sati dea erori 8-|...

142sj0l.png

Underground-GFX

Posted

@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!

Posted

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

Posted

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

Posted

Pune ma:

DeletePlayer3DTextLabel( playerid, speedo3Dtext );

In loc de:

DeletePlayer3DTextLabel( i, speedo3Dtext );

142sj0l.png

Underground-GFX

Posted

Eu la asta trb sa modific ca sa dispara..

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

The Legend

Posted

Aia e bine, cu aia nu ai nicio treaba, aia e cand Dezactivezi FS-ul sa zicem asa.. Tu fa cum tiam zis eu..

142sj0l.png

Underground-GFX

Posted

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

Posted

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 !

Posted

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

Posted

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 !

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.