07.05.2011, 09:33
[Tutorial] How to create a plugin
07.05.2011, 10:04
Did you recompile with F7, and copied the new .dll to plugins (I'm sure you did, but who knows)?
Otherwise, I suggest you to delete that project and retry everything.
Otherwise, I suggest you to delete that project and retry everything.
07.05.2011, 10:06
Quote:
Did you recompile with F7, and copied the new .dll to plugins (I'm sure you did, but who knows)?
Otherwise, I suggest you to delete that project and retry everything. |
PS: I retried to make it again, didn't worked.
Gotta re-do it again to see...
07.05.2011, 10:08
Time to have some fun, I've been wanting to learn about this for ages!
07.05.2011, 10:10
My bad. I wrote it correct but the picture is wrong. You have to write *.def next to "Module Definition File".
Changing picture now..
EDIT: Changed.
Changing picture now..
EDIT: Changed.
07.05.2011, 10:18
07.05.2011, 10:19
Awesome work Ryder
07.05.2011, 10:49
Good tutorial!
07.05.2011, 14:26
If that happens then I will create a discussion topic suggesting that useless releases will be deleted. There's no need coding a plugin if you can do it in PAWN already, with minor exceptions.
Thanks for the tut. Now let's hope people won't go moronic about C++ -.-
Thanks for the tut. Now let's hope people won't go moronic about C++ -.-
07.05.2011, 14:37
It's not that easy so I don't think it will happen.
08.05.2011, 08:53
Wow Thank you so much !!! XD I think it's the first tut for making plugins ?!
It's awesome
It's awesome
08.05.2011, 10:49
Finally :O
Good job Ryder!Explainfull and very usefull,thanks.
Good job Ryder!Explainfull and very usefull,thanks.
08.05.2011, 10:54
Finally YESS thx youu
08.05.2011, 14:45
(
Последний раз редактировалось me-borno; 08.05.2011 в 15:26.
)
Ok, ive figuered out that whould work at all..
this is my new atempt:
but when i try this, the server actually crashes :S
it builds fine, but still... its crashes.
this is my new atempt:
Код:
static cell AMX_NATIVE_CALL GetVehicleName(AMX *amx, cell *params) { char* name = "No Vehicle"; ... return char (name); }
it builds fine, but still... its crashes.
08.05.2011, 16:52
Quote:
Ok, ive figuered out that whould work at all..
this is my new atempt: Код:
static cell AMX_NATIVE_CALL GetVehicleName(AMX *amx, cell *params) { char* name = "No Vehicle"; ... return char (name); } it builds fine, but still... its crashes. |
08.05.2011, 16:59
(
Последний раз редактировалось me-borno; 08.05.2011 в 19:23.
)
Quote:
You can't return a string that you can use in PAWN. You have to use amx_GetAddr and amx_SetString.
|
Edit:
Ok, i almost found out how it works.
i made a function wich returns the vehicle name, and i almost works!
Код:
static cell AMX_NATIVE_CALL GetVehicleName(AMX *amx, cell *params) { cell* addr = NULL; char* name = "No Vehicle"; switch(params[1]) { case 400: name = "Landstalker"; break; case 401: name = "Bravura"; break; case 402: name = "Buffalo"; break; case 403: name = "Linerunner"; break; ... case 609: name = "Boxville"; break; case 610: name = "Farm Plow"; break; case 611: name = "Utility Trailer"; break; } amx_GetAddr(amx, params[2], &addr); amx_SetString(addr, name, NULL, NULL, 64); logprintf("DEBUG: addr: %d name: %s", addr, name); return 1; }
Код:
printf("<Debug> %s", GetVehicleName(401));
Код:
[21:23:27] <Debug> ☺ [21:23:27] Bravura
09.05.2011, 10:55
thank you, this will give me a jumpstart without having to figure this out.
does anyone have experience with this + netbeans if you want to run it on a linux server?
does anyone have experience with this + netbeans if you want to run it on a linux server?
13.05.2011, 21:55
I have a question about this. Maybe someone knows? I know how to call natives from SA-MP to C++, but I don't know how to do it for functions like GetPlayerPos. Anyone has any idea how we can use GetPlayerPos in C++?
13.05.2011, 22:13
Quote:
I have a question about this. Maybe someone knows? I know how to call natives from SA-MP to C++, but I don't know how to do it for functions like GetPlayerPos. Anyone has any idea how we can use GetPlayerPos in C++?
|
Here it is: https://sampforum.blast.hk/showthread.php?tid=87938
14.05.2011, 13:56
(
Последний раз редактировалось Sasino97; 14.05.2011 в 14:36.
)
THANKS VERY MUCH!!!!!!
This tutorial is what I was looking for!!!!!!!!!
But a question, what C++ functions can I use to make a working plug-in on SA-MP?
This tutorial is what I was looking for!!!!!!!!!
But a question, what C++ functions can I use to make a working plug-in on SA-MP?
« Next Oldest | Next Newest »
Users browsing this thread: 8 Guest(s)