iPanter Posted May 20, 2018 Share Posted May 20, 2018 Salut, am facut un sistem de crate + un textdraw si nu stiu cum sa adaug noul textdraw in sistem. Ma poate ajuta cineva va rog? Deoarece nu prea ma pricep cu textdraw-urile. https://pastebin.com/a7VF38zT Link to comment Share on other sites More sharing options...
Administrator Leonard Posted May 20, 2018 Administrator Share Posted May 20, 2018 Nu va invatat Edison si cum sa modificati... Pur si simplu, faci un nou textdraw si il faci compatibil cu sistemu. www.liberty.mp Link to comment Share on other sites More sharing options...
iPanter Posted May 20, 2018 Author Share Posted May 20, 2018 Textdraw-ul l-am facut.. Nu stiu cum sa-l fac compatibil. Link to comment Share on other sites More sharing options...
iPanter Posted May 25, 2018 Author Share Posted May 25, 2018 (edited) Am facut asa: https://pastebin.com/LYczM3Sh si primesc erorile astea: Linia: if(CrateTime > 0) { [debug] AMX backtrace: [debug] #0 0035e4fc in public Timers () at C:\Users\Andrei\Desktop\burned.ro\gamemodes\wa-rpg.pwn:31352 [debug] Run time error 4: "Array index out of bounds" [debug] Accessing element at index 1995 past array upper bound 1000 Edited May 25, 2018 by iPanter Link to comment Share on other sites More sharing options...
Administrator Leonard Posted May 25, 2018 Administrator Share Posted May 25, 2018 foreach( new x : Player ) { if( CrateTime[ x ] > 0 ) { CrateTime[ x ] --; new amount, rand, string[ 256 ]; if( CrateType[ x ] == 1 ) { rand = random( 30 ); } else { rand = random( 50 ); } switch( rand ) { case 0..15: { amount = random( 5 ) + 5; if( CrateType[ x ] == 1 ) { amount += 5; } format( string, sizeof string, "Step: %d/30~n~~y~%sx RP", 30 - CrateTime[ x ], FormatNumber( amount ) ); PlayerTextDrawSetString( x, CrateTD[ 4 ], string ); if( CrateTime[ x ] == 0 ) { PlayerInfo[ x ][ pExp ] += amount; Update( x, pRP ); SCM( x, COLOR_LGREEN, "Felicitari! Ai castigat RP-uri!" ); SetTimerEx( "hideCrateTextdraws", 2000, true, "d", x ); } } case 16..25: { amount = random( 50 ) + 100; if( CrateType[ x ] == 1 ) { amount += 100; } format(string, sizeof string, "Step: %d/30~n~~p~%s PremiumPoints", 30 - CrateTime[ x ], FormatNumber( amount ) ); PlayerTextDrawSetString( x, CrateTD[ 4 ], string ); if( CrateTime[ x ] == 0 ) { PlayerInfo[ x ][ pPremiumPoints ] += amount; Update( x, pPremiumPoints ); SCM( x, COLOR_LGREEN, "Felicitari! Ai castigat PremiumPoints!" ); SetTimerEx( "hideCrateTextdraws", 2000, true, "d", x ); } } default: { amount = random( 1000000 ) + 500000; if( CrateType[ x ] == 1 ) { amount += 500000; } format(string, sizeof string, "Step: %d/30~n~~g~$%s", 30 - CrateTime[ x ], FormatNumber( amount ) ); PlayerTextDrawSetString( x, CrateTD[ 4 ], string ); if( CrateTime[ x ] == 0 ) { GivePlayerCash(x, amount); Update( x, pCashx ); SCM( x, COLOR_LGREEN, "Felicitari! Ai castigat bani!" ); } } } } } function hideCrateTextdraws( playerid ) { for( new i = 0; i < 5; i++) { PlayerTextDrawHide( playerid, CrateTD[ i ] ); } return true; } Ti-am facut eu partea de td si ti-am pus un timer care sa stearga singur textdraw-urile. www.liberty.mp Link to comment Share on other sites More sharing options...
iPanter Posted May 26, 2018 Author Share Posted May 26, 2018 (edited) @LeonardAdv https://imgur.com/a/0MDehKs C:\Users\Andrei\Desktop\burned.ro\gamemodes\wa-rpg.pwn(31164) : warning 219: local variable "x" shadows a variable at a preceding level C:\Users\Andrei\Desktop\burned.ro\gamemodes\wa-rpg.pwn(31164) : error 017: undefined symbol "Player" C:\Users\Andrei\Desktop\burned.ro\gamemodes\wa-rpg.pwn(31164) : error 017: undefined symbol "Player" C:\Users\Andrei\Desktop\burned.ro\gamemodes\wa-rpg.pwn(31164) : warning 215: expression has no effect C:\Users\Andrei\Desktop\burned.ro\gamemodes\wa-rpg.pwn(31164) : error 001: expected token: ";", but found "]" C:\Users\Andrei\Desktop\burned.ro\gamemodes\wa-rpg.pwn(31164) : fatal error 107: too many error messages on one line Edited May 26, 2018 by iPanter Link to comment Share on other sites More sharing options...
Administrator Leonard Posted May 26, 2018 Administrator Share Posted May 26, 2018 Da-mi sursa de la erori. www.liberty.mp Link to comment Share on other sites More sharing options...
iPanter Posted May 26, 2018 Author Share Posted May 26, 2018 (edited) @ foreach( new x : Player ) Si aici e aia cu argument type mismach. PlayerTextDrawSetString(playerid, CrateTD, "Loading..."); PlayerTextDrawShow(playerid, CrateTD); Edited May 26, 2018 by iPanter Link to comment Share on other sites More sharing options...
Administrator Leonard Posted May 26, 2018 Administrator Share Posted May 26, 2018 In loc de foreach( new x : Player ) pune foreach(new x : Player) Iar la textdraw, vezi ca e CrateTD[ numarul textdraw-ului ] www.liberty.mp Link to comment Share on other sites More sharing options...
iPanter Posted May 26, 2018 Author Share Posted May 26, 2018 @LeonardAdv https://imgur.com/a/V0BPyMg Link to comment Share on other sites More sharing options...
Recommended Posts