Jump to content

Speedometer gen nephrite.


K0vrigel

Recommended Posts

Salut,astazi o sa va invat cum sa faceti un speedometer gen nephrite.

Arata cam asa:

LuoKuHb.png

(!EU AM LUCRAT PE GAMEMODE-UL BLUFFS,AL LUI @Ionut_WS SI NU STIU DACA TEXTDRAW-URILE SE NUMESC LA FEL PE ORICE GAMEMODE!!

Deci,sa incepem.

Prima data vom cauta in gamemode:

PlayerText:Speedd[MAX_PLAYERS]

Si o vom inlocui cu:

PlayerText:Speedd[MAX_PLAYERS][2]

Q:DE CE?

A:Ei bine,vom folosi 2 textdraw-uri de speed pentru acest speedometer.

Apoi mergem la:

public OnPlayerStateChange

si cautam la: 

    if(newstate == PLAYER_STATE_ONFOOT)
PlayerTextDrawHide(playerid, Speedd[playerid]);

Vom copia asta si o vom inlocui cu:

PlayerTextDrawHide(playerid, Speedd[playerid][0]);
	PlayerTextDrawHide(playerid, Speedd[playerid][1]); 

Q:De ce am pus 0,1?

A:Deoarece numerotarea incepe de la 0 si de oarece sunt 2 textdraw-uri folosim 0,1.

Acum vom merge mai departe,la 

public Checkvehinfo()

mai exact la:

if(GetPlayerState(i) == PLAYER_STATE_DRIVER)

Vom gasi ceva de genul:

     PlayerTextDrawShow(i, Speedd[i]);
                format(str1,sizeof(str1),"Speed:~r~%d km/h",spe);
                PlayerTextDrawSetString(i, Speedd[i], str1); 

Inlocuim cu:

     PlayerTextDrawShow(i, Speedd[i][0]);
                format(str1,sizeof(str1),"~r~%d",spe);
                PlayerTextDrawSetString(i, Speedd[i][0], str1);
                PlayerTextDrawShow(i, Speedd[i][1]);
                format(str1,sizeof(str1),"km/h");
                PlayerTextDrawSetString(i, Speedd[i][1], str1);

Apoi,mergem putin mai jos la:

 if(GetPlayerState(i) == PLAYER_STATE_PASSENGER)

Punem aceasi chestie pe care v-am dat-o mai sus.

Dam scroll down putin pana gasim:

PlayerTextDrawHide(i, Speedd[i]);

Inlocuim cu:

                PlayerTextDrawHide(i, Speedd[i][0]);
                           PlayerTextDrawHide(i, Speedd[i][1]);

Asta a fost tutorialul,mai jos aveti textdraw-urile:

https://pastebin.com/EnveqwDb

 

DACA AVETI INTREBARI LE PUTETI LASA IN SECTIUNEA DE COMENTARII!

 

 

 

Edited by K0vrigel
Link to comment
Share on other sites

C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6394) : error 033: array must be indexed (variable "Speedd")
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6395) : error 035: argument type mismatch (argument 2)
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6396) : error 035: argument type mismatch (argument 2)
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6397) : error 035: argument type mismatch (argument 2)
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6398) : error 035: argument type mismatch (argument 2)
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6399) : error 035: argument type mismatch (argument 2)
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6400) : error 035: argument type mismatch (argument 2)
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6401) : error 035: argument type mismatch (argument 2)
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6402) : error 035: argument type mismatch (argument 2)
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(14592) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(14592 -- 14593) : warning 215: expression has no effect
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(14593) : error 001: expected token: ";", but found "if"
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(44712) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


12 Errors.

 Încearcă să fii un om de valoare și nu neapărat un om de succes.

 

Link to comment
Share on other sites

1 hour ago, K0vrigel said:

(!EU AM LUCRAT PE GAMEMODE-UL BLUFFS,AL LUI @Ionut_WS SI NU STIU DACA TEXTDRAW-URILE SE NUMESC LA FEL PE ORICE GAMEMODE!!

Textdraw-urile le-ai numit chiar tu, in 'tutorialul' asta :)) 

 

Checkvehinfo, str1, spe,  nu le-ai definit. Nu mai face tutoriale daca stii ca nu stapanesti la perfectie informatia pe care o dai., mai bine le citesti

Nu te supara pe mine, e o sugestie :P

  • Haha 1
Link to comment
Share on other sites

C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6344) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6344) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6344) : warning 215: expression has no effect
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6344) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6344) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

 Încearcă să fii un om de valoare și nu neapărat un om de succes.

 

Link to comment
Share on other sites

3 hours ago, KB.HERO said:

C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6344) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6344) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6344) : warning 215: expression has no effect
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6344) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\Gamemode\gamemodes\BigZoneGM.pwn(6344) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

ce ai acolo pe linia 6344?

Link to comment
Share on other sites

Speed[playerid] = CreatePlayerTextDraw(playerid, 519.199951, 359.147064");

Speed[playerid] = CreatePlayerTextDraw(playerid, 519.199951, 359.147064,"_");

 

Sunt 2 variante, inlocuieste linia aia cu aceste doua, pe rand, si vezi cum se compileaza.

Link to comment
Share on other sites

  • 10 months later...
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.