29.07.2013, 19:04
Hey there guys I made myself a little Textdrawscript but as i was nearly done with it weird mistakes came up.
I tried to fix them about a whole day .
So i hope you could help me out with it.
Heres the Code.
,10000,1);
Please just give me working solutions
I tried to fix them about a whole day .
So i hope you could help me out with it.
Heres the Code.
Код:
#include <a_samp> new TextdrawInterfaceTimer[MAX_PLAYERS]; //------------------------------------------------------------------------------ new Text:Textdrawgroundline; new Players; //------------------------------------------------------------------------------ new Text:MovingServerText; //------------------------------------------------------------------------------ new Text:Ping[MAX_PLAYERS]; new Pingamount[MAX_PLAYERS]; //------------------------------------------------------------------------------ new Text:Playertextdraw; //------------------------------------------------------------------------------ new Text:Scoretextdraw[MAX_PLAYERS]; //------------------------------------------------------------------------------ new Text:Speedtextdraw[MAX_PLAYERS]; //------------------------------------------------------------------------------ new Text:Cartextdraw[MAX_PLAYERS]; //------------------------------------------------------------------------------ public OnFilterScriptInit() { //server textdraws Textdrawgroundline = TextDrawCreate(0.000000, 437.000000, " ~b~=> Please Dont abusively ram other people !"); TextDrawBackgroundColor(Textdrawgroundline, -1); TextDrawFont(Textdrawgroundline, 1); TextDrawLetterSize(Textdrawgroundline, 0.229998, 0.999998); TextDrawColor(Textdrawgroundline, 255); TextDrawSetOutline(Textdrawgroundline, 1); TextDrawSetProportional(Textdrawgroundline, 1); TextDrawUseBox(Textdrawgroundline, 1); TextDrawBoxColor(Textdrawgroundline, 0x000000AA); TextDrawTextSize(Textdrawgroundline, 639.000000, 8.000000); //MovingServerText MovingServerText = TextDrawCreate(500.000000,6.000000,""); TextDrawBackgroundColor(MovingServerText,0x000000ff); TextDrawFont(MovingServerText,2); TextDrawLetterSize(MovingServerText,0.377777, 1.077777); TextDrawColor(MovingServerText,0xffffffff); TextDrawSetOutline(MovingServerText,1); TextDrawSetProportional(MovingServerText,1); TextDrawUseBox(MovingServerText, 1); //Players Playertextdraw = TextDrawCreate(547.000000,66.000000,""); TextDrawBackgroundColor(Playertextdraw,0x000000ff); TextDrawFont(Playertextdraw,2); TextDrawLetterSize(Playertextdraw,0.257777, 1.077777); TextDrawColor(Playertextdraw,0xffffffff); TextDrawSetOutline(Playertextdraw,1); TextDrawSetProportional(Playertextdraw,1); TextDrawUseBox(Playertextdraw, 1); SetTimer("TextDrawMove",10000,1); SetTimer("MovingServerTextTextdraw",200,1); SetTimer("UpdateSpeed",200,1); return 1; } //------------------------------------------------------------------------------ public OnPlayerDisconnect(playerid) { Players --; return 1; } //------------------------------------------------------------------------------ public OnPlayerConnect(playerid) { Players ++; return 1; } //------------------------------------------------------------------------------ public OnPlayerDeath(playerid,killerid) { //deathskull TextDrawSetPreviewModel(Cartextdraw[playerid], 1254); TextDrawSetPreviewRot(Cartextdraw[playerid], 0.0, 0.0, 0.0, 1.5); TextDrawShowForPlayer(playerid,Cartextdraw[playerid]); //kill interface timer KillTimer(TextdrawInterfaceTimer[playerid]); return 1; } //------------------------------------------------------------------------------ stock LoadPlayerTextdraws(playerid) { //ping Ping[playerid] = TextDrawCreate(547.000000,51.000000,""); TextDrawBackgroundColor(Ping[playerid],0x000000ff); TextDrawFont(Ping[playerid],2); TextDrawLetterSize(Ping[playerid],0.257777, 1.077777); TextDrawColor(Ping[playerid],0xffffffff); TextDrawSetOutline(Ping[playerid],1); TextDrawSetProportional(Ping[playerid],1); TextDrawUseBox(Ping[playerid], 1); //Score Scoretextdraw[playerid] = TextDrawCreate(547.000000,36.000000,""); TextDrawBackgroundColor(Scoretextdraw[playerid],0x000000ff); TextDrawFont(Scoretextdraw[playerid],2); TextDrawLetterSize(Scoretextdraw[playerid],0.257777, 1.077777); TextDrawColor(Scoretextdraw[playerid],0xffffffff); TextDrawSetOutline(Scoretextdraw[playerid],1); TextDrawSetProportional(Scoretextdraw[playerid],1); TextDrawUseBox(Scoretextdraw[playerid], 1); //Speed Speedtextdraw[playerid] = TextDrawCreate(547.000000,21.000000,""); TextDrawBackgroundColor(Speedtextdraw[playerid],0x000000ff); TextDrawFont(Speedtextdraw[playerid],2); TextDrawLetterSize(Speedtextdraw[playerid],0.257777, 1.077777); TextDrawColor(Speedtextdraw[playerid],0xffffffff); TextDrawSetOutline(Speedtextdraw[playerid],1); TextDrawSetProportional(Speedtextdraw[playerid],1); TextDrawUseBox(Speedtextdraw[playerid], 1); //cartextdraw Cartextdraw[playerid] = TextDrawCreate(498.2,21, "_"); TextDrawFont(Cartextdraw[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW); TextDrawUseBox(Cartextdraw[playerid], 1); TextDrawBoxColor(Cartextdraw[playerid], 0x000000FF); TextDrawTextSize(Cartextdraw[playerid], 45.0, 58.0); TextDrawSetPreviewModel(Cartextdraw[playerid], 411); TextDrawSetPreviewVehCol(Cartextdraw[playerid], 1, 1); TextDrawSetPreviewRot(Cartextdraw[playerid], -10.0, 0.0, -20.0, 1.0); return 1; } stock DestroyPlayerTextdraws(playerid) { TextDrawHideForPlayer(playerid,Ping[playerid]); TextDrawDestroy(Ping[playerid]); TextDrawHideForPlayer(playerid,Scoretextdraw[playerid]); TextDrawDestroy(Scoretextdraw[playerid]); TextDrawHideForPlayer(playerid,Speedtextdraw[playerid]); TextDrawDestroy(Speedtextdraw[playerid]); TextDrawHideForPlayer(playerid,Cartextdraw[playerid]); TextDrawDestroy(Cartextdraw[playerid]); return 1; } //------------------------------------------------------------------------------ forward TextDrawMove(); public TextDrawMove() { static Msg1; switch (Msg1) { case 0: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> Usefull Commands: /cmds /goal /radio /flist /admins /rules"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 1; } case 1: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> Seen any Hackers ? Report them with : /report <playerid> <reason>"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 2; } case 2: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> If you get Bored of SA Radio. Try our Online /radio"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 3; } case 3: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> Buy Car Tuning Parts at the /shop and customize your vehicle"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 4; } case 4: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> Also dont forget to checkout our Forum http://xtreme-dm.enjin.com"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 5; } case 5: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> IF you get banned make a screenshot of the ban please !"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 6; } case 6: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> If you loose please dont flame like a little kiddy :D"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 7; } case 7: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> Are you good at DM Race Mapping ?We are looking for some Mappers"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 8; } case 8: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> Found any Bug ? Post it on our forum http://xtreme-dm.enjin.com"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 9; } case 9: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> Dont ask for being an Admin in the chat PLEASE"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 10; } case 10: { new tmp2[128]; format(tmp2, sizeof(tmp2), " ~b~=> We hope you enjoy your stay on Xtreme DM/DD !"); TextDrawSetString(Textdrawgroundline, tmp2); TextDrawShowForAll(Textdrawgroundline); Msg1 = 0; } } return 1; } //------------------------------------------------------------------------------ forward UpdatePingScorePlayer(playerid); public UpdatePingScorePlayer(playerid) { //Ping new tmp4[128]; Pingamount[playerid] = GetPlayerPing(playerid); if(Pingamount[playerid] <= 90) { format(tmp4, sizeof(tmp4), "Ping: ~g~%i GOOD",Pingamount[playerid]); } else if(Pingamount[playerid] >= 90 && Pingamount[playerid] <= 130) { format(tmp4, sizeof(tmp4), "Ping: ~y~%i OK",Pingamount[playerid]); } else if(Pingamount[playerid] >= 130 && Pingamount[playerid] <= 500) { format(tmp4, sizeof(tmp4), "Ping: ~r~%i BAD",Pingamount[playerid]); } TextDrawSetString(Ping[playerid], tmp4); TextDrawShowForAll(Ping[playerid]); //------------------------------------------------------------------------------ //Players new tmp5[128]; format(tmp5, sizeof(tmp5), "Players: ~g~%i/%i",Players,MAX_PLAYERS); TextDrawSetString(Playertextdraw, tmp5); TextDrawShowForAll(Playertextdraw); //------------------------------------------------------------------------------ //Score new tmp6[128]; format(tmp6, sizeof(tmp6), "Score: ~g~%i",GetPlayerScore(playerid)); TextDrawSetString(Scoretextdraw[playerid], tmp6); TextDrawShowForAll(Scoretextdraw[playerid]); return 1; } //------------------------------------------------------------------------------ forward UpdateSpeed(playerid); public UpdateSpeed(playerid) { //Speed new tmp7[128]; new Float:p[3]; GetVehicleVelocity(GetPlayerVehicleID(playerid),p[0],p[1],p[2]); format(tmp7, sizeof(tmp7), "Speed: ~g~%.0f KM/H",150.0*(p[0]*p[0]+p[1]*p[1])); TextDrawSetString(Speedtextdraw[playerid], tmp7); TextDrawShowForAll(Speedtextdraw[playerid]); return 1; } //------------------------------------------------------------------------------ forward MovingServerTextTextdraw(); public MovingServerTextTextdraw() { static Msg2; switch (Msg2) { case 0: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~r~X~w~treme-DM&D~r~D"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 1; } case 1: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~y~X~r~t~w~reme-DM&~r~D~y~D"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 2; } case 2: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~y~Xt~r~r~w~eme-DM~r~&~y~DD"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 3; } case 3: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~y~Xtr~r~e~w~me-D~r~M~y~&DD"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 4; } case 4: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~y~Xtre~r~m~w~e-~r~D~y~M&DD"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 5; } case 5: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~y~Xtrem~r~e-~y~DM&DD"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 6; } case 6: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~g~X~y~treme-DM&D~g~D"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 7; } case 7: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~g~X~g~t~y~reme-DM&~g~DD"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 8; } case 8: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~g~Xt~g~r~y~eme-DM~g~&DD"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 9; } case 9: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~g~Xtr~g~e~y~me-D~g~M&DD"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 10; } case 10: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~g~Xtre~g~m~y~e-~g~DM&DD"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 11; } case 11: { new tmp3[128]; format(tmp3, sizeof(tmp3), "~g~Xtrem~g~e-~g~DM&DD"); TextDrawSetString(MovingServerText, tmp3); TextDrawShowForAll(MovingServerText); Msg2 = 0; } } return 1; } //------------------------------------------------------------------------------ public OnPlayerSpawn(playerid) { DestroyPlayerTextdraws(playerid); LoadPlayerTextdraws(playerid); TextDrawShowForAll(MovingServerText); TextDrawShowForAll(Textdrawgroundline); /* TextDrawShowForAll(Scoretextdraw[playerid]); TextDrawShowForAll(Speedtextdraw[playerid]); TextDrawShowForAll(Ping[playerid]); TextDrawShowForAll(Playertextdraw); */ //setback to vehicleobject TextDrawSetPreviewModel(Cartextdraw[playerid], 411); TextDrawSetPreviewVehCol(Cartextdraw[playerid], 1, 1); TextDrawSetPreviewRot(Cartextdraw[playerid], -10.0, 0.0, -20.0, 1.0); TextDrawShowForPlayer(playerid, Cartextdraw[playerid]); TextdrawInterfaceTimer[playerid] = SetTimer("UpdatePingScorePlayer",1000,true); return 1; }
Please just give me working solutions