K0vrigel Posted June 24, 2018 Posted June 24, 2018 (edited) Salut,astazi o sa va invat cum sa faceti un speedometer gen nephrite. Arata cam asa: (!) 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 June 24, 2018 by K0vrigel
KB.HERO Posted June 24, 2018 Posted June 24, 2018 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.
Lunoxx Posted June 24, 2018 Posted June 24, 2018 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 1 Servicii scripting calitative: https://www.sa-mp.ro/forums/topic/26143-l-ofer-servicii-scripting-de-calitate/ Contact: Skype: alin.m99 Discord: Lunoxx#1155 Email: [email protected] Facebook: facebook.com/pawnscripts
K0vrigel Posted June 24, 2018 Author Posted June 24, 2018 (edited) Nu este nevoie sa definesc eu,odata ce sunt definite in gamemode. Edited June 24, 2018 by K0vrigel
KB.HERO Posted June 24, 2018 Posted June 24, 2018 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.
K0vrigel Posted June 24, 2018 Author Posted June 24, 2018 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?
KB.HERO Posted June 24, 2018 Posted June 24, 2018 Speed[playerid] = CreatePlayerTextDraw(playerid, 519.199951, 359.147064, " "); Încearcă să fii un om de valoare și nu neapărat un om de succes.
Qubit Posted June 24, 2018 Posted June 24, 2018 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.
Nica_Mihai Posted May 4, 2019 Posted May 4, 2019 (edited) Chiar nu seamana cu cel de la nephrite. Dar daca esti incepator este bine. Edited May 4, 2019 by Nica_Mihai
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now