Comments (14)
Use hooked macros first. Because the macros will add the file and line number to the plugin when your game mod is compiled.
A simple example: Change CreateDynamicPlayerTextDraw to CreatePlayerTextDraw.
This is an example of how to use a clickable textdraw.
// * Includes *
#include "a_samp.inc"
#include "colors.inc"
#include "textdraw-streamer.inc"
// * Variables *
new PlayerText: MainMenuBtns[MAX_PLAYERS][3];
// * Main *
main()
{
print("Main Menu test...");
}
// * On Game Mode Init *
public OnGameModeInit()
{
return 1;
}
// * On Game Mode Init *
public OnGameModeExit()
{
return 1;
}
// * On Player Connect *
public OnPlayerConnect(playerid)
{
if(!IsPlayerNPC(playerid))
{
CreateMainMenuPlayerTD(playerid);
ShowMainMenuTD(playerid);
}
return 1;
}
// * On Click Dynamic Player Textdraw *
public OnClickDynamicPlayerTextDraw(playerid, PlayerText: textid)
{
// Main Menu textdraws opened
if(GetPVarInt(playerid, "main_menu_td") == 1)
{
if(textid == MainMenuBtns[playerid][0])
{
SendClientMessage(playerid, -1, "PLAY");
return 0;
}
if(textid == MainMenuBtns[playerid][1])
{
SendClientMessage(playerid, -1, "RULES");
return 0;
}
if(textid == MainMenuBtns[playerid][2])
{
SendClientMessage(playerid, -1, "CREDITS");
return 0;
}
}
return 0;
}
public OnCancelDynamicTextDraw(playerid)
{
// Main Menu textdraws opened
if(GetPVarInt(playerid, "main_menu_td") == 1)
{
HideMainMenuTD(playerid);
}
return 1;
}
// * Functions *
CreateMainMenuPlayerTD(playerid)
{
MainMenuBtns[playerid][0] = CreateDynamicPlayerTextDraw(playerid, 570.000000, 155.000000, "PLAY");
DynamicPlayerTextDrawFont(playerid, MainMenuBtns[playerid][0], 2);
DynamicPlayerTextDrawLetterSize(playerid, MainMenuBtns[playerid][0], 0.258332, 1.750000);
DynamicPlayerTextDrawTextSize(playerid, MainMenuBtns[playerid][0], 16.500000, 83.000000);
DynamicPlayerTextDrawSetOutline(playerid, MainMenuBtns[playerid][0], 0);
DynamicPlayerTextDrawSetShadow(playerid, MainMenuBtns[playerid][0], 0);
DynamicPlayerTextDrawAlignment(playerid, MainMenuBtns[playerid][0], 2);
DynamicPlayerTextDrawColour(playerid, MainMenuBtns[playerid][0], -1);
DynamicPlayerTextDrawBGColour(playerid, MainMenuBtns[playerid][0], 255);
DynamicPlayerTextDrawBoxColor(playerid, MainMenuBtns[playerid][0], 9109704);
DynamicPlayerTextDrawUseBox(playerid, MainMenuBtns[playerid][0], 1);
DynPlayerTextSetProportional(playerid, MainMenuBtns[playerid][0], 1);
DynamicPlayerTextDrawSelectable(playerid, MainMenuBtns[playerid][0], 1);
MainMenuBtns[playerid][1] = CreateDynamicPlayerTextDraw(playerid, 570.000000, 198.000000, "RULES");
DynamicPlayerTextDrawFont(playerid, MainMenuBtns[playerid][1], 2);
DynamicPlayerTextDrawLetterSize(playerid, MainMenuBtns[playerid][1], 0.258332, 1.750000);
DynamicPlayerTextDrawTextSize(playerid, MainMenuBtns[playerid][1], 16.500000, 83.000000);
DynamicPlayerTextDrawSetOutline(playerid, MainMenuBtns[playerid][1], 0);
DynamicPlayerTextDrawSetShadow(playerid, MainMenuBtns[playerid][1], 0);
DynamicPlayerTextDrawAlignment(playerid, MainMenuBtns[playerid][1], 2);
DynamicPlayerTextDrawColour(playerid, MainMenuBtns[playerid][1], -1);
DynamicPlayerTextDrawBGColour(playerid, MainMenuBtns[playerid][1], 255);
DynamicPlayerTextDrawBoxColor(playerid, MainMenuBtns[playerid][1], -1962934072);
DynamicPlayerTextDrawUseBox(playerid, MainMenuBtns[playerid][1], 1);
DynPlayerTextSetProportional(playerid, MainMenuBtns[playerid][1], 1);
DynamicPlayerTextDrawSelectable(playerid, MainMenuBtns[playerid][1], 1);
MainMenuBtns[playerid][2] = CreateDynamicPlayerTextDraw(playerid, 570.000000, 243.000000, "CREDITS");
DynamicPlayerTextDrawFont(playerid, MainMenuBtns[playerid][2], 2);
DynamicPlayerTextDrawLetterSize(playerid, MainMenuBtns[playerid][2], 0.258332, 1.750000);
DynamicPlayerTextDrawTextSize(playerid, MainMenuBtns[playerid][2], 16.500000, 83.000000);
DynamicPlayerTextDrawSetOutline(playerid, MainMenuBtns[playerid][2], 0);
DynamicPlayerTextDrawSetShadow(playerid, MainMenuBtns[playerid][2], 0);
DynamicPlayerTextDrawAlignment(playerid, MainMenuBtns[playerid][2], 2);
DynamicPlayerTextDrawColour(playerid, MainMenuBtns[playerid][2], -1);
DynamicPlayerTextDrawBGColour(playerid, MainMenuBtns[playerid][2], 255);
DynamicPlayerTextDrawBoxColor(playerid, MainMenuBtns[playerid][2], 1296911816);
DynamicPlayerTextDrawUseBox(playerid, MainMenuBtns[playerid][2], 1);
DynPlayerTextSetProportional(playerid, MainMenuBtns[playerid][2], 1);
DynamicPlayerTextDrawSelectable(playerid, MainMenuBtns[playerid][2], 1);
return 1;
}
ShowMainMenuTD(playerid)
{
SetPVarInt(playerid, "main_menu_td", 1);
for(new i = 0; i < sizeof(MainMenuBtns); i++)
{
DynamicPlayerTextDrawShow(playerid, MainMenuBtns[playerid][i]);
}
SelectTextDraw(playerid, 0x00FF00FF);
return 1;
}
HideMainMenuTD(playerid)
{
DeletePVar(playerid, "main_menu_td");
for(new i = 0; i < sizeof(MainMenuBtns); i++)
{
DynamicPlayerTextDrawHide(playerid, MainMenuBtns[playerid][i]);
}
return 1;
}
from samp-textdraw-streamer.
Ow thats it!! Thank u!!
from samp-textdraw-streamer.
Whoa! There's an warning in that code.
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(65) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(65) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(66) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(66) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(67) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(67) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(68) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(68) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(69) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(69) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(70) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(70) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(71) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(71) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(72) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(72) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(73) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(73) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(74) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(74) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(75) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(75) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(76) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(76) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(79) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(79) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(80) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(80) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(81) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(81) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(82) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(82) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(83) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(83) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(84) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(84) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(85) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(85) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(86) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(86) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(87) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(87) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(88) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(88) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(89) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(89) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(90) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(90) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(93) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(93) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(94) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(94) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(95) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(95) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(96) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(96) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(97) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(97) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(98) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(98) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(99) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(99) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(100) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(100) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(101) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(101) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(102) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(102) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(103) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(103) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(104) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(104) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(113) : warning 202: number of arguments does not match definition
C:\Users\Jeybi\Desktop\Testing Gamemode\gamemodes\mainmenu.pwn(113) : warning 202: number of arguments does not match definition
from samp-textdraw-streamer.
What is your compiler version? Which server file are you using, SA:MP or Open.MP?
from samp-textdraw-streamer.
im using SA:MP and my compiler version is 3.10.10
from samp-textdraw-streamer.
Do your library files have const compatibility?
Try updating your libraries with the files here.
pawn-stdlib
samp-stdlib
from samp-textdraw-streamer.
yes i have. My problem is i updated the include and the plugin of textdraw-streamer to v2.0.3 (hot fix) then the warnings start showing up
from samp-textdraw-streamer.
when i remove these codes in textdraw-streamer.inc the warnings are gone.
// I remove the const file and line
native DynamicPlayerTextDrawFont(playerid, PlayerText:textid, font, const file[], line); - Original
native DynamicPlayerTextDrawFont(playerid, PlayerText:textid, font); - Edited
// I remove the _file and _line
#define PlayerTextDrawFont(%0,%1,%2) DynamicPlayerTextDrawFont(%0, %1, %2, __file, __line) - Original
#define PlayerTextDrawFont(%0,%1,%2) DynamicPlayerTextDrawFont(%0, %1, %2) - Edited
from samp-textdraw-streamer.
i think there's an issue in the include
from samp-textdraw-streamer.
Can you try it in an empty game mode, because I don't get this warning. It's probably the #include ordering.
from samp-textdraw-streamer.
no matter what I do, there are still warnings
from samp-textdraw-streamer.
Can you share your game mod with all its files?
from samp-textdraw-streamer.
https://www.mediafire.com/file/e4j08hqkxx66ry9/Testing+GM.zip/file
Here's the files.
from samp-textdraw-streamer.
Your compiler version is old.
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
You need to change the function names, they should be like this.
MainMenuBtns[playerid][0] = CreatePlayerTextDraw(playerid, 570.000000, 155.000000, "PLAY");
PlayerTextDrawFont(playerid, MainMenuBtns[playerid][0], 2);
PlayerTextDrawLetterSize(playerid, MainMenuBtns[playerid][0], 0.258332, 1.750000);
PlayerTextDrawTextSize(playerid, MainMenuBtns[playerid][0], 16.500000, 83.000000);
// other codes
Not like this
MainMenuBtns[playerid][0] = CreateDynamicPlayerTextDraw(playerid, 570.000000, 155.000000, "PLAY");
DynamicPlayerTextDrawFont(playerid, MainMenuBtns[playerid][0], 2);
DynamicPlayerTextDrawLetterSize(playerid, MainMenuBtns[playerid][0], 0.258332, 1.750000);
DynamicPlayerTextDrawTextSize(playerid, MainMenuBtns[playerid][0], 16.500000, 83.000000);
// other codes
from samp-textdraw-streamer.
Related Issues (20)
- i got error
- GLIBC_2.34 HOT 10
- [textdraw.streamer] DestroyDynamicPlayerTextDraw: No such id was found. (playerid: 0, textId: 0) (NOTIFIKASISYSTEM\SHOWITEMBOX.pwn:19) HOT 7
- does it work on filterscripts ? HOT 5
- hmm after including HOT 7
- undefined symbol __file HOT 1
- Textdraw colors aren't right HOT 9
- Player Has Stuck like a play animation After Open Textdraw HOT 1
- [SOLVED] Help me on this issue
- Stuck Animation & Broken TextDraw HOT 3
- td's not working properly HOT 1
- Help me HOT 1
- hello help please HOT 7
- as textdraw ficou bugada. HOT 11
- help me please! HOT 1
- Is it bypass sprite limits? HOT 2
- [textdraw.streamer] DestroyDynamicPlayerTextDraw: No such id was found. (playerid: 0, textId: 0) (server-package\ui-fivem.pwn:177) HOT 7
- Textdraw being displayed out of order HOT 2
- Function Not Registered HOT 1
- [Info] [textdraw.streamer] DynamicPlayerTextDrawHide: No such id was found. (playerid: 0, textId: 0) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samp-textdraw-streamer.