public OnPlayerConnect(playerid) { MenuID[playerid] = -1; pHasItems[playerid] = 0; J_TMenu[playerid][0] = CreatePlayerTextDraw(playerid, 128.249816, 170.266815, "Header"); PlayerTextDrawLetterSize(playerid, J_TMenu[playerid][0], 0.541876, 1.489166); PlayerTextDrawAlignment(playerid, J_TMenu[playerid][0], 2); PlayerTextDrawColor(playerid, J_TMenu[playerid][0], -5963521); PlayerTextDrawSetShadow(playerid, J_TMenu[playerid][0], 0); PlayerTextDrawSetOutline(playerid, J_TMenu[playerid][0], 0); PlayerTextDrawBackgroundColor(playerid, J_TMenu[playerid][0], 255); PlayerTextDrawFont(playerid, J_TMenu[playerid][0], 3); PlayerTextDrawSetProportional(playerid, J_TMenu[playerid][0], 1); PlayerTextDrawSetShadow(playerid, J_TMenu[playerid][0], 0); J_TMenu[playerid][1] = CreatePlayerTextDraw(playerid, 15.724655, 169.533676, "Content"); PlayerTextDrawLetterSize(playerid, J_TMenu[playerid][1], 0.251874, 0.940833); PlayerTextDrawTextSize(playerid, J_TMenu[playerid][1], 266.977142, 0.000000); PlayerTextDrawAlignment(playerid, J_TMenu[playerid][1], 1); PlayerTextDrawColor(playerid, J_TMenu[playerid][1], -1); PlayerTextDrawUseBox(playerid, J_TMenu[playerid][1], 1); PlayerTextDrawBoxColor(playerid, J_TMenu[playerid][1], 120); PlayerTextDrawSetShadow(playerid, J_TMenu[playerid][1], 1); PlayerTextDrawSetOutline(playerid, J_TMenu[playerid][1], 0); PlayerTextDrawBackgroundColor(playerid, J_TMenu[playerid][1], 255); PlayerTextDrawFont(playerid, J_TMenu[playerid][1], 1); PlayerTextDrawSetProportional(playerid, J_TMenu[playerid][1], 1); PlayerTextDrawSetShadow(playerid, J_TMenu[playerid][1], 1); #if defined J_OnPlayerConnect return J_OnPlayerConnect(playerid); #else return 1; #endif
CMD:test(playerid) { new Test[600],bool:necessary = true; if(necessary) { strcat(Test,"~y~1-~w~ Body Armor ~g~ $1000~n~"); strcat(Test,"~y~2-~w~ Chainsaw ~g~ $26000~n~"); strcat(Test,"~y~3-~w~ Silenced Pistol ~b~(250ammo) ~g~ $4500~n~"); strcat(Test,"~y~4-~w~ Desert Eagle ~b~(100ammo) ~g~ $7500~n~"); strcat(Test,"~y~5-~w~ Desert Eagle ~b~(250ammo) ~g~ $15000~n~"); strcat(Test,"~y~6-~w~ Mac 10 ~b~(250ammo) ~g~ $24000~n~"); strcat(Test,"~y~7-~w~ Mac 10 ~b~(500ammo) ~g~ $35000~n~"); strcat(Test,"~y~8-~w~ MP5 ~b~(250ammo) ~g~ $32000~n~"); strcat(Test,"~y~9-~w~ MP5 ~b~(500ammo) ~g~ $52000~n~"); strcat(Test,"~y~10-~w~ Sawnoff Shotgun ~b~(250ammo) ~g~ $18000~n~"); strcat(Test,"~y~11-~w~ Sawnoff Shotgun ~b~(500ammo) ~g~ $32000~n~"); strcat(Test,"~y~12-~w~ AK-47 ~b~(250ammo) ~g~ $29000~n~"); strcat(Test,"~y~13-~w~ AK-47 ~b~(500ammo) ~g~ $38000~n~"); strcat(Test,"~y~14-~w~ M4 ~b~(250ammo) ~g~ $36000~n~"); strcat(Test,"~y~15-~w~ M4 ~b~(500ammo) ~g~ $58000~n~"); strcat(Test,"~y~16-~w~ Sniper Rifle ~b~(125ammo) ~g~ $8500~n~"); strcat(Test,"~y~17-~w~ Sniper Rifle ~b~(300ammo) ~g~ $16500~n~"); necessary = false; } TextMenuShowForPlayer(playerid,0,"Ammunation",Test,17); return 1; } public OnTextMenuResponse(playerid,menuid,listitem) { if(menuid == 0) { switch(listitem) { case 1: { GivePlayerWeapon(playerid, 9, 1); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, -1000); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased Body Armor For $1000"); } case 2: { GivePlayerWeapon(playerid, 9, 1); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, -26000); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A Chainsaw For $26000"); } case 3: { GivePlayerWeapon(playerid, 23, 250); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A Silenced Pistol For $4500"); } case 4: { GivePlayerWeapon(playerid, 24, 100); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A Desert Eagle For $4500"); } case 5: { GivePlayerWeapon(playerid, 24, 250); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A Desert Eagle For $4500"); } case 6: { GivePlayerWeapon(playerid, 28, 250); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A Mac 10 For $4500"); } case 7: { GivePlayerWeapon(playerid, 28, 500); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A Mac 10 For $4500"); } case 8: { GivePlayerWeapon(playerid, 29, 250); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A MP5 For $4500"); } case 9: { GivePlayerWeapon(playerid, 29, 500); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A MP5 For $4500"); } case 10: { GivePlayerWeapon(playerid, 26, 250); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A Sawnoff Shotgun For $4500"); } case 11: { GivePlayerWeapon(playerid, 26, 500); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A Sawnoff Shotgun For $4500"); } case 12: { GivePlayerWeapon(playerid, 30, 250); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A AK-47 Shotgun For $4500"); } case 13: { GivePlayerWeapon(playerid, 30, 500); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A AK-47 For $4500"); } case 14: { GivePlayerWeapon(playerid, 31, 250); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A M4 For $4500"); } case 15: { GivePlayerWeapon(playerid, 31, 500); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A M4 For $4500"); } case 16: { GivePlayerWeapon(playerid, 34, 125); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A Sniper Rifle For $4500"); } case 17: { GivePlayerWeapon(playerid, 34, 300); // Give playerid a sawn-off shotgun with 64 ammo //Your stuff GivePlayerMoney(playerid, 4500); ApplyAnimation(playerid,"INT_SHOP","shop_pay",4.0,0,0,0,0,0); SendClientMessage(playerid, -1, "You Have Purchased A Sniper Rifle For $4500"); } } } return 1;
Originally Posted by wiki.sa-mp.com
(***) Although the textdraw string limit is 1024 characters, if colour codes (e.g. ~r~) are used beyond the 255th character it may crash the client.
|
Beware of this:
I am not sure if this could be in relation to your problem, but try removing color codes temporarily and see what happens. Also, you could possibly create two menus? (Next/prev and pages) Another thing could be that you're not using sufficient with size in the "TextDrawTextSize" function. https://sampwiki.blast.hk/wiki/TextDrawTextSize It's mainly just a guess, but could also have an impact on the text. |
It could be divided into two/three textdraws showing the text
You just have to try what I said above and see if it could bring you any further on the way |