Re: How to create a plugin -
kacper55331 - 15.05.2011
Hi, II would do something like that, in gamemodzie gives:
Код:
native StartScript();
and every filterscripcie works:
Код:
public OnScriptInit()
//Edit
And how to take advantage of the MySQL plugin, for example, to retrieve the name of the item and return it.
Re: How to create a plugin -
Sasino97 - 16.05.2011
What are the c++ functions i can use
Re: How to create a plugin -
RyDeR` - 16.05.2011
Quote:
Originally Posted by [GF]Sasino97
What are the c++ functions i can use
|
****** for it.
EDIT:
@Fj0rtizFredde:
Thanks, it's working with invoke.
Re: How to create a plugin -
Sasino97 - 16.05.2011
I tried, but I didn't find nothing.... I typed "How to make a sa-mp plugin"
Re: How to create a plugin -
RyDeR` - 16.05.2011
Quote:
Originally Posted by [GF]Sasino97
I tried, but I didn't find nothing.... I typed "How to make a sa-mp plugin"
|
Well, I guess it's better for you to stick with PAWN... But if you really want to create something using C++ functions I'd recommend this site ->
http://www.cplusplus.com/
Re: How to create a plugin -
Sasino97 - 16.05.2011
Thankyou
!!
Re: How to create a plugin -
Mean - 17.05.2011
I KNOW you might not answer, but I happen to get 2 errors, tried some fixing, but no success, I'm a newbie @ VS.
Код:
error C2065: 'MyNat' : undeclared identifier
error C2365: 'MyNat' : redefinition; previous definition was 'formerly unknown identifier'
code
Код:
static cell AMX_NATIVE_CALL MyNat(AMX *amx, cell *params)
{
logprintf("Test, test :p.");
return 1;
}
and
Код:
AMX_NATIVE_INFO projectNatives[] =
{
{ "MyNat", MyNat }
};
Re: How to create a plugin -
RyDeR` - 17.05.2011
I have no idea why you get the error, but you shouldn't get it if you have done everything correctly. Just begin a new project and try again, should work!
Re: How to create a plugin -
Raimis_R - 17.05.2011
I was searching something like this about 2 weeks.
Thanks RyDeR`!
Edit: where i can read about amx functions or something ho can help in dev plugin.
Like ur
pawn Code:
int __IsPlayerConnected(int playerid, AMX *amx) // AMX *amx must stay but it's just the playerid parameter that counts in his function.
{
int
index
;
if(!amx_FindPublic(amx, "__IsPlayerConnected", &index))
{
cell
retVal
;
amx_Push(amx, playerid);
amx_Exec(amx, &retVal, index);
return (int)retVal;
}
return -1;
}
Where i can find like __IsPlayerConnected or this like stock in pawn?
Re: How to create a plugin -
me-borno - 19.05.2011
Hello,
im back with a new question :S
but, when i use floats in pawno, it becomes a different value in C++..
like -2000 becomes about 300 billion.. i already used float() int() etc. but nothing helps..
how to uses floats in c++
Ty in advance!
Solved, use amx_ctof or amx_ftoc
Re: How to create a plugin -
Patrik356b - 21.05.2011
This tutorial is good, but the sdk seems to be a bit goofy, since the compiler complains about not finding amxplugin.h even after i choose to include all files. Tried with MS Visual C++ 2008
Re: How to create a plugin - 0x5A656578 - 21.05.2011
There's no amxplugin.h in it, did you mean amx.h?
Re: How to create a plugin -
Patrik356b - 21.05.2011
No, my compiler asks for "amxplugin.h"
Will try to get around it by checking project settings and such
Re: How to create a plugin -
mariomako - 21.05.2011
error!!
Re: How to create a plugin -
sabretur - 25.05.2011
Awesome, thank you
Re: How to create a plugin -
CyNiC - 26.05.2011
Quote:
Originally Posted by Mean
I KNOW you might not answer, but I happen to get 2 errors, tried some fixing, but no success, I'm a newbie @ VS.
Code:
error C2065: 'MyNat' : undeclared identifier
error C2365: 'MyNat' : redefinition; previous definition was 'formerly unknown identifier'
code
Code:
static cell AMX_NATIVE_CALL MyNat(AMX *amx, cell *params)
{
logprintf("Test, test :p.");
return 1;
}
and
Code:
AMX_NATIVE_INFO projectNatives[] =
{
{ "MyNat", MyNat }
};
|
Put this:
pawn Code:
static cell AMX_NATIVE_CALL MyNat(AMX *amx, cell *params)
{
logprintf("Test, test :p.");
return 1;
}
Before this:
pawn Code:
AMX_NATIVE_INFO projectNatives[] =
{
{ "MyNat", MyNat }
};
Re: How to create a plugin -
1337connor - 29.05.2011
1. I can't seem to get logprintf to work with a string for example
logprintf("%s",params[1]);
2. How do I
make it say something when my
plugin is loaded.
Re: How to create a plugin -
iggy1 - 30.05.2011
You could use existing c++ libraries to write text to the console. Just a suggestion.
pawn Code:
#include <iostream>//at top
static cell AMX_NATIVE_CALL MyNat(AMX *amx, cell *params)
{
std::cout << "test " << params[1] << std::endl; // cout defined in iostream
return 1;
}
Re: How to create a plugin -
Cenation - 30.05.2011
Awesome!!!
Re: How to create a plugin -
RyDeR` - 30.05.2011
Quote:
Originally Posted by 1337connor
1. I can't seem to get logprintf to work with a string for example
logprintf("%s",params[1]);
2. How do I make it say something when my plugin is loaded.
|
1. Of course it won't work. You have to use "amx_StrParam(amx, params[1], buffer);". After this the data in params 1 will be in buffer.
2. Put it under "PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData)"