SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 11/05/2013, 05:29 AM   #81
Guest123
Huge Clucker
 
Guest123's Avatar
 
Join Date: Mar 2013
Location: Malaysia
Posts: 316
Reputation: 3
Default Re: Plugin development guide

but, how to edit .dll using C++ ?
__________________
..
Guest123 is offline   Reply With Quote
Old 11/05/2013, 05:46 AM   #82
Emmet_
Guest
 
Posts: n/a
Default Re: Plugin development guide

Quote:
Originally Posted by Guest123 View Post
but, how to edit .dll using C++ ?
Microsoft Visual Studio C++ or something like that, but you need the source files

On topic: Nice tutorial, still reading it now haha. I'm gonna create some simple stuff with this stuff, thanks :3
  Reply With Quote
Old 17/05/2013, 05:22 PM   #83
Aeonosphere
Little Clucker
 
Join Date: May 2013
Posts: 17
Reputation: 5
Default Re: Plugin development guide

Could someone tell me where to find the following functions (which .h file?)

-amx_Register
-amx_GetString
-amx_GetAddr
-amx_StrLen

Thanks.
Aeonosphere is offline   Reply With Quote
Old 17/05/2013, 05:26 PM   #84
Slice
High-roller
 
Join Date: Mar 2008
Location: Sweden
Posts: 1,899
Reputation: 1589
Default Re: Plugin development guide

Quote:
Originally Posted by Aeonosphere View Post
Could someone tell me where to find the following functions (which .h file?)

-amx_Register
-amx_GetString
-amx_GetAddr
-amx_StrLen

Thanks.
https://www.******.se/search?q=amx_G...g+filetype%3Ah
Slice is offline   Reply With Quote
Old 26/05/2013, 12:37 PM   #85
Edvin
Gangsta
 
Edvin's Avatar
 
Join Date: Dec 2010
Posts: 868
Reputation: 71
Default Re: Plugin development guide

I've started to learn how to create a plugin. I followed the pictures instrunctions from the main post, and after i taken this code, also from main post, to try to compile it:
Code:
#include "SDK\amx\amx.h"
#include "SDK\plugincommon.h"

#include "Invoke.h"

#include <string>
#include <vector>

#include <cstdlib>
#include <ctime> 


typedef void (*logprintf_t)(char* format, ...);

logprintf_t logprintf;
extern void *pAMXFunctions;


using namespace std;


//This function demonstrates: how to get a string (and its length) from PAWN.
//PAWN native: native PrintPawnString(const str[]);
cell AMX_NATIVE_CALL PrintPawnString(AMX* amx, cell* params)
{
    int 
        len = NULL,
        ret = NULL;

    cell *addr  = NULL;

    //Get the address of our string param (str) and then get its length
    amx_GetAddr(amx, params[1], &addr); 
    amx_StrLen(addr, &len);

    //if the length of input isnt 0
    if(len)
    {
        //We increase len because we want to make room for the terminating null char when we allocate memory.
        //Also because GetString's size parameter counts the null chracter, we have to specify the length
        //of the string + 1; otherwise our string will be truncated to make room for the null char (we'd lose 1 character).
        len++;

        //Allocate memory to hold our string we're passing (str) and then "get" the string using our allocated memory to store it.
        char* text = new char[ len ];
        amx_GetString(text, addr, 0, len);

        //Use logprintf to print out string (text). We dont use std::cout because it doesnt write to the server log (only the window).
        logprintf(text);

        //Deallocate our memory...
        delete[] text;
    }
    return 1;
}

//This function demonstrates: How to call a callback that is in a PAWN script.
//PAWN native: native EmitPawnCallback();
cell AMX_NATIVE_CALL EmitPawnCallback(AMX* amx, cell* params)
{
    int idx;

    const cell var = 3;
    const cell arr[] = {100, 4, 33};
    const string str = "Some random message from C++.";


    //Pawn callback: forward OnPawnCallbackEmitted(var, arr[], str[]);
    //Find our callback and store its place in the public function table (it's index) into our idx var.
    if(!amx_FindPublic(amx, "OnPawnCallbackEmitted", &idx))
    {
        cell
            ret, 
            addr;

        //Here we push our arguments to our function. Note that if the function has multiple arguments you have to push your
        //values in reverse order! Thats why we're pushing the string first, then the array, and finally our integer.

        amx_PushString(amx, &addr, NULL, str.c_str(), NULL, NULL);
        //amx_PushArray(amx, NULL, NULL, arr, sizeof(arr) / sizeof(cell));

        cell
            amx_addr, 
            *phys_addr;

        //For some reason amx_PushArray seems to be crashing the server, and i have NO idea why. My usage should be completely
        //valid judging from the implementers guide, and the code itself. Since the function isnt working we'll have to
        //use the old method and allocate the memory, set it, and push it all ourselves. This is pretty straight forward. We
        //allocate memory on the heap using amx_Allot (this returns 2 addresses- one of the location in the abstract machine
        //(amx_addr), and one relative to the actual server's address space (phsy_addr - which we can use in C++)). Once the 
        //memory is allocated we use memcpy to copy the memory from our array to our phys_addr address location.
        amx_Allot(amx, sizeof(arr) / sizeof(cell), &amx_addr, &phys_addr);
        memcpy(phys_addr, arr, sizeof(arr));
        amx_Push(amx, amx_addr);
        
        //Push our integer value
        amx_Push(amx, var);

        //Execute our function using our previously obtained idx var.
        //Note: This function's second parameter is what the callback returned (Can be NULL if you're not interested in return values).
        amx_Exec(amx, &ret, idx);

        //Release our memory that we allocated. The function amx_Alloc allocates memory on the heap in the abstract machine.
        //The functions amx_PushString and amx_PushArray both use this function internally so you have to release the memory every time
        //you use one of those functions. NOTE: We used both amx_PushString and amx_PushArray, and yet we only have ONE release call.
        //This is because memory on the heap is allocated in ascending order! amx_Release release all the memory above a certain point 
        //(the second parameter, amx_addr - which is our addr variable). Since it does this we ONLY store the address from the amx_PushString 
        //call, as it'll delete everything from that point on. 
        amx_Release(amx, addr);

        //Print the return value (for completeness).
        logprintf("EmitPawnCallback NOTE:  OnPawnCallbackEmitted callback returned %d!", ret);

    }
    return 1;
}


//This function demonstrates: an alternative method to getting strings from pawn- and the possible risks that come with it.
//PAWN native: native PrintPawnString2(const str[]);
cell AMX_NATIVE_CALL PrintPawnString2(AMX* amx, cell* params)
{
    //This method is NOT recomended as the amx_StrParam macro uses the alloca function which is NOT a standard in C, OR C++.
    //Using this method comes with risks of overflowing the stack (If you allocate large amounts of memory) and also
    //gives you the risk of bugs (this function is machine AND compiler dependent- some implementations are said to be bugged).

    char* text = NULL;
    amx_StrParam(amx, params[1], text);

    //Check if text is null
    if(text != NULL)
    {
        //Use logprintf to print out string (text). We dont use std::cout because it doesnt write to the server log (only the window).
        logprintf(text);
    }
    return 1;   
}

//This function demonstrates: how to modify a PAWN string.
//PAWN native: native SetPawnString(str[], len = sizeof(str));
cell AMX_NATIVE_CALL SetPawnString(AMX* amx, cell* params)
{
    const string message = "This is a string from C/++!!";
    cell* addr = NULL;

    //Get the address of our string parameter (str) and store our message 
    amx_GetAddr(amx, params[1], &addr);
    amx_SetString(addr, message.c_str(), 0, 0, params[2]);
    return 1;
}

//This function demonstrates: how to cast a float to a PAWN float.
//PAWN native: native Float:ReturnPawnFloatVal();
cell AMX_NATIVE_CALL ReturnPawnFloatVal(AMX* amx, cell* params)
{
    //Since PAWN is a typeless language it stores everything as a 32bit integer and relies on tags to handle special data.
    //A floating point number is no exception to this; It's a still 32bit int, but it has a Float tag to show that it shouldnt
    //be treated like an regular integer. So how do we convert a float to an 32bit integer (for PAWN) without losing data?
    //The answer is the amx_ftoc macro!

    //The macro amx_ftoc type casts a float into a cell while preserving its bit pattern (amx_ctof does the inverse).
    const float f = 22.624f;
    return amx_ftoc(f);
}

//This function demonstrates: How to pass parameters by reference.
//PAWN native: native SetPawnReferenceVars(&value1, &Float:value2);
cell AMX_NATIVE_CALL SetPawnReferenceVars(AMX* amx, cell* params)
{
    const int val = 65;
    const float val2 = 84.54f;

    cell* addr[2] = {NULL, NULL};
    
    //Get the addresses of "value1" and "value2"
    amx_GetAddr(amx, params[1], &addr[0]);
    amx_GetAddr(amx, params[2], &addr[1]);

    //Dereference our pointers and assign our values. Remember to ALWAYS use the macro "amx_ftoc" to convert floats into 
    //cells (the appropriate float format for PAWN)!
    *addr[0] = val;
    *addr[1] = amx_ftoc(val2);

    return 1;
}

//This function demonstrates: how to get and modify array values.
//PAWN native: native PrintPawnArray(arr[], size = sizeof(arr));
cell AMX_NATIVE_CALL PrintPawnArray(AMX* amx, cell* params)
{
    //Make sure there's something to print...
    if(params[2] > 0)
    {
        cell* addr = NULL;

        //Get the address of the first value in our PAWN array.
        amx_GetAddr(amx, params[1], &addr);

        for(int i = 0, l = params[2]; i < l; i++)
        {
            //This is pretty straight forward: We dereference the addr pointer to get our value to print.
            //You should know this already, but arrays and pointers are almost the same thing, so we can use pointer
            //arithmetic to add an offset OR just use the subscript operator (in the end *(addr+1) and addr[1] are the same).
            logprintf("arr[%d] = %d", i, *(addr + i));

            //If you wanted to modify the array you would just change its value by dereferencing addr and assigning a new value. 
            //You should know this as well, im just adding it in for completeness. Here we change the first value of our array
            //to 5 (Note: Since its the first value, no offset it used).

            // *(addr) = 5;   
        }
    }
    return 1;
}

//This function demonstrates: setting up invoke (fetching the addresses of our natives).
//PAWN native: native Invoke_GetAddresses();
cell AMX_NATIVE_CALL Invoke_GetAddresses(AMX* amx, cell* params)
{
    return g_Invoke->getAddresses();
}

//This function demonstrates: how to use invoke to call SA-MP natives.
//PAWN native: native WhereIsPlayer(playerid);
cell AMX_NATIVE_CALL WhereIsPlayer(AMX* amx, cell* params)
{
    float
        x = NULL,
        y = NULL,
        z = NULL;

    //Get the player's position (and check to see if he is even connected).
    if(g_Invoke->callNative(&PAWN::GetPlayerPos, params[1], &x, &y, &z))
    {
        char name[24];

        //Get the rest of the player's information (name, interior, and virtualworld) and print it.
        g_Invoke->callNative(&PAWN::GetPlayerName, params[1], name);
        int interior = g_Invoke->callNative(&PAWN::GetPlayerInterior, params[1]);
        int virtualworld = g_Invoke->callNative(&PAWN::GetPlayerVirtualWorld, params[1]);

        logprintf("%s is at X: %.2f, Y: %.2f, Z: %.2f (Virtual world: %d, Interior %d).", name, x, y, z, virtualworld, interior);
        return 1;

    }
    return 0;
}

//This function demonstrates: how to write a native to act as a callback.
//PAWN native: native TEST_Hook_OnPlayerConnnect(playerid);
cell AMX_NATIVE_CALL TEST_Hook_OnPlayerConnnect(AMX* amx, cell* params)
{
    //Get the players name 
    char name[24];
    g_Invoke->callNative(&PAWN::GetPlayerName, params[1], name);
    
    //Check if his name is "Mario".
    if(string("Mario") == name)
    {
        //If it is send our funny little message and kick him.
        g_Invoke->callNative(&PAWN::SendClientMessage, params[1], 0xFFFFFFFF, "Sorry {FF0000}Mario, {FFFFFF}but your princess is in another server.");
        g_Invoke->callNative(&PAWN::Kick, params[1]);
    }
    return 1;
}


//This function tells the server what capabilities our plugin will have based on what it returns. Generally we only use 3 support flags 
//in plugins: SUPPORTS_VERSION, SUPPORTS_AMX_NATIVES, and SUPPORTS_PROCESS_TICK.
PLUGIN_EXPORT unsigned int PLUGIN_CALL Supports() 
{
    //Note: If you're using the ProccessTick function, remember to export it in the .def file!
    return SUPPORTS_VERSION | SUPPORTS_AMX_NATIVES | SUPPORTS_PROCESS_TICK;
}

//The Load function is pretty straight forward. This is called when the plugin is loaded and gets passed an array of addresses that the plugin 
//will use to function. The two indexes we typically use are PLUGIN_DATA_AMX_EXPORTS, and PLUGIN_DATA_LOGPRINTF.
PLUGIN_EXPORT bool PLUGIN_CALL Load(void **ppData) 
{
    //allocate memory for out g_Invoke instance
    g_Invoke = new Invoke;

    //Assign the addresses of our AMX function table/logprintf function to their corasponding pointers.
    pAMXFunctions = ppData[PLUGIN_DATA_AMX_EXPORTS];
    logprintf = (logprintf_t) ppData[PLUGIN_DATA_LOGPRINTF];

    logprintf("* Test plugin was loaded.");
    return true;
}

//Unload is called when the plugin is unloaded (server shutdown).
PLUGIN_EXPORT void PLUGIN_CALL Unload()
{
    logprintf("* Test plugin was unloaded.");
}

//Our array of native info for amx_Register (function name and address).
AMX_NATIVE_INFO PluginNatives[] =
{
    {"PrintPawnString", PrintPawnString},
    {"PrintPawnString2", PrintPawnString2},
    {"SetPawnString", SetPawnString},
    {"ReturnPawnFloatVal", ReturnPawnFloatVal},
    {"SetPawnReferenceVars", SetPawnReferenceVars},
    {"PrintPawnArray", PrintPawnArray},
    {"EmitPawnCallback", EmitPawnCallback},
    {"WhereIsPlayer", WhereIsPlayer},
    {"Invoke_GetAddresses", Invoke_GetAddresses},
    {"TEST_Hook_OnPlayerConnnect", TEST_Hook_OnPlayerConnnect},
    {0, 0}
};

//This function is called when a new AMX instance is loaded into the server. This will be called for every filterscript/gamemode! Because of this it isnt 
//a good idea to store a single AMX instance for the entire plugin, instead use a queue/list/vector. In this function we also register our custom 
//native functions we wish to provide PAWN with. 
PLUGIN_EXPORT int PLUGIN_CALL AmxLoad( AMX *amx ) 
{
    //Any time a script is loaded we want to add it to invoke's AMX list, so we push back the list with the instance.
    g_Invoke->amx_list.push_back(amx);
    return amx_Register(amx, PluginNatives, -1);
}

//This function is called when every an AMX instance is unloaded. If you store AMX instances, make sure you remove them. Otherwise you'll have instances to 
//non-existing gamemodes/filterscripts.
PLUGIN_EXPORT int PLUGIN_CALL AmxUnload( AMX *amx ) 
{
    //Every script that is unloaded needs to get removed from our AMX instance list. So we iterate through our list and find the instance that is being 
    //unloaded, and we earase it from the list.
    for(list<AMX *>::iterator i = g_Invoke->amx_list.begin(); i != g_Invoke->amx_list.end(); ++i)
    {
        if(*i == amx)
        {
            g_Invoke->amx_list.erase(i);
            break;
        }
    }
    return AMX_ERR_NONE;
}

//ProcessTick is a function that gets called on every iteration of the server's loop. People generally use this function as a method of managing time by 
//keeping track of the amount of ticks that have passed. The SA-MP server is said to have a sleep time of 5ms, so if 50 ticks go by you have an idea of 
// the elapsed time (5 * 50 = 250ms). Note: Anyone who uses threads in their plugins and require PAWN interaction needs to use this function to ensure 
//PAWN isnt busy doing another task!
PLUGIN_EXPORT void PLUGIN_CALL ProcessTick()
{
    static int tick = 0;
    const int NYAN_COUNT = 100;

    tick++;

    //Use the modulo operator to see if NYAN_COUNT ticks have passed (100 tick. 5ms sleep time * 100 ticks = 500ms). 
    if(!(tick % NYAN_COUNT))
    {
        //If 100 ticks have passed send our funny little message to everyone.
        const char nyan[] = "{FF0000}NYAN {FFA500}NYAN {FFFF00}NYAN {00FF00}NYAN {0000FF}NYAN {551A8B}NYAN";
        g_Invoke->callNative(&PAWN::SendClientMessageToAll, 0, nyan);
    }
}
but, i have errors, o each line i think, i don't know what i did wrong:
Code:
1>test.def(1): warning LNK4017: #include statement not supported for the target platform; ignored
1>test.def(2): warning LNK4017: #include statement not supported for the target platform; ignored
1>test.def(4): warning LNK4017: #include statement not supported for the target platform; ignored
1>test.def(6): warning LNK4017: #include statement not supported for the target platform; ignored
1>test.def(7): warning LNK4017: #include statement not supported for the target platform; ignored
1>test.def(9): warning LNK4017: #include statement not supported for the target platform; ignored
1>test.def(10): warning LNK4017: #include statement not supported for the target platform; ignored
1>test.def(13): warning LNK4017: typedef statement not supported for the target platform; ignored
1>test.def(15): warning LNK4017: logprintf_t statement not supported for the target platform; ignored
1>test.def(16): warning LNK4017: extern statement not supported for the target platform; ignored
1>test.def(19): warning LNK4017: using statement not supported for the target platform; ignored
1>test.def(22): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(23): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(24): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(25): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(26): warning LNK4017: int statement not supported for the target platform; ignored
1>test.def(27): warning LNK4017: len statement not supported for the target platform; ignored
1>test.def(28): warning LNK4017: ret statement not supported for the target platform; ignored
1>test.def(30): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(32): warning LNK4017: //Get statement not supported for the target platform; ignored
1>test.def(33): warning LNK4017: amx_GetAddr(amx, statement not supported for the target platform; ignored
1>test.def(34): warning LNK4017: amx_StrLen(addr, statement not supported for the target platform; ignored
1>test.def(36): warning LNK4017: //if statement not supported for the target platform; ignored
1>test.def(37): warning LNK4017: if(len) statement not supported for the target platform; ignored
1>test.def(38): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(39): warning LNK4017: //We statement not supported for the target platform; ignored
1>test.def(40): warning LNK4017: //Also statement not supported for the target platform; ignored
1>test.def(41): warning LNK4017: //of statement not supported for the target platform; ignored
1>test.def(42): warning LNK4017: len++ statement not supported for the target platform; ignored
1>test.def(44): warning LNK4017: //Allocate statement not supported for the target platform; ignored
1>test.def(45): warning LNK4017: char* statement not supported for the target platform; ignored
1>test.def(46): warning LNK4017: amx_GetString(text, statement not supported for the target platform; ignored
1>test.def(48): warning LNK4017: //Use statement not supported for the target platform; ignored
1>test.def(49): warning LNK4017: logprintf(text) statement not supported for the target platform; ignored
1>test.def(51): warning LNK4017: //Deallocate statement not supported for the target platform; ignored
1>test.def(52): warning LNK4017: delete[] statement not supported for the target platform; ignored
1>test.def(53): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(54): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(55): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(57): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(58): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(59): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(60): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(61): warning LNK4017: int statement not supported for the target platform; ignored
1>test.def(63): warning LNK4017: const statement not supported for the target platform; ignored
1>test.def(64): warning LNK4017: const statement not supported for the target platform; ignored
1>test.def(65): warning LNK4017: const statement not supported for the target platform; ignored
1>test.def(68): warning LNK4017: //Pawn statement not supported for the target platform; ignored
1>test.def(69): warning LNK4017: //Find statement not supported for the target platform; ignored
1>test.def(70): warning LNK4017: if(!amx_FindPublic(amx, statement not supported for the target platform; ignored
1>test.def(71): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(72): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(73): warning LNK4017: ret, statement not supported for the target platform; ignored
1>test.def(74): warning LNK4017: addr statement not supported for the target platform; ignored
1>test.def(76): warning LNK4017: //Here statement not supported for the target platform; ignored
1>test.def(77): warning LNK4017: //values statement not supported for the target platform; ignored
1>test.def(79): warning LNK4017: amx_PushString(amx, statement not supported for the target platform; ignored
1>test.def(80): warning LNK4017: //amx_PushArray(amx, statement not supported for the target platform; ignored
1>test.def(82): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(83): warning LNK4017: amx_addr, statement not supported for the target platform; ignored
1>test.def(84): warning LNK4017: *phys_addr statement not supported for the target platform; ignored
1>test.def(86): warning LNK4017: //For statement not supported for the target platform; ignored
1>test.def(87): warning LNK4017: //valid statement not supported for the target platform; ignored
1>test.def(88): warning LNK4017: //use statement not supported for the target platform; ignored
1>test.def(89): warning LNK4017: //allocate statement not supported for the target platform; ignored
1>test.def(90): warning LNK4017: //(amx_addr), statement not supported for the target platform; ignored
1>test.def(91): warning LNK4017: //memory statement not supported for the target platform; ignored
1>test.def(92): warning LNK4017: amx_Allot(amx, statement not supported for the target platform; ignored
1>test.def(93): warning LNK4017: memcpy(phys_addr, statement not supported for the target platform; ignored
1>test.def(94): warning LNK4017: amx_Push(amx, statement not supported for the target platform; ignored
1>test.def(96): warning LNK4017: //Push statement not supported for the target platform; ignored
1>test.def(97): warning LNK4017: amx_Push(amx, statement not supported for the target platform; ignored
1>test.def(99): warning LNK4017: //Execute statement not supported for the target platform; ignored
1>test.def(100): warning LNK4017: //Note: statement not supported for the target platform; ignored
1>test.def(101): warning LNK4017: amx_Exec(amx, statement not supported for the target platform; ignored
1>test.def(103): warning LNK4017: //Release statement not supported for the target platform; ignored
1>test.def(104): warning LNK4017: //The statement not supported for the target platform; ignored
1>test.def(105): warning LNK4017: //you statement not supported for the target platform; ignored
1>test.def(106): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(107): warning LNK4017: //(the statement not supported for the target platform; ignored
1>test.def(108): warning LNK4017: //call, statement not supported for the target platform; ignored
1>test.def(109): warning LNK4017: amx_Release(amx, statement not supported for the target platform; ignored
1>test.def(111): warning LNK4017: //Print statement not supported for the target platform; ignored
1>test.def(112): warning LNK4017: logprintf("EmitPawnCallback statement not supported for the target platform; ignored
1>test.def(114): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(115): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(116): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(119): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(120): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(121): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(122): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(123): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(124): warning LNK4017: //Using statement not supported for the target platform; ignored
1>test.def(125): warning LNK4017: //gives statement not supported for the target platform; ignored
1>test.def(127): warning LNK4017: char* statement not supported for the target platform; ignored
1>test.def(128): warning LNK4017: amx_StrParam(amx, statement not supported for the target platform; ignored
1>test.def(130): warning LNK4017: //Check statement not supported for the target platform; ignored
1>test.def(131): warning LNK4017: if(text statement not supported for the target platform; ignored
1>test.def(132): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(133): warning LNK4017: //Use statement not supported for the target platform; ignored
1>test.def(134): warning LNK4017: logprintf(text) statement not supported for the target platform; ignored
1>test.def(135): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(136): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(137): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(139): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(140): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(141): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(142): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(143): warning LNK4017: const statement not supported for the target platform; ignored
1>test.def(144): warning LNK4017: cell* statement not supported for the target platform; ignored
1>test.def(146): warning LNK4017: //Get statement not supported for the target platform; ignored
1>test.def(147): warning LNK4017: amx_GetAddr(amx, statement not supported for the target platform; ignored
1>test.def(148): warning LNK4017: amx_SetString(addr, statement not supported for the target platform; ignored
1>test.def(149): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(150): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(152): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(153): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(154): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(155): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(156): warning LNK4017: //Since statement not supported for the target platform; ignored
1>test.def(157): warning LNK4017: //A statement not supported for the target platform; ignored
1>test.def(158): warning LNK4017: //be statement not supported for the target platform; ignored
1>test.def(159): warning LNK4017: //The statement not supported for the target platform; ignored
1>test.def(161): warning LNK4017: //The statement not supported for the target platform; ignored
1>test.def(162): warning LNK4017: const statement not supported for the target platform; ignored
1>test.def(163): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(164): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(166): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(167): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(168): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(169): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(170): warning LNK4017: const statement not supported for the target platform; ignored
1>test.def(171): warning LNK4017: const statement not supported for the target platform; ignored
1>test.def(173): warning LNK4017: cell* statement not supported for the target platform; ignored
1>test.def(175): warning LNK4017: //Get statement not supported for the target platform; ignored
1>test.def(176): warning LNK4017: amx_GetAddr(amx, statement not supported for the target platform; ignored
1>test.def(177): warning LNK4017: amx_GetAddr(amx, statement not supported for the target platform; ignored
1>test.def(179): warning LNK4017: //Dereference statement not supported for the target platform; ignored
1>test.def(180): warning LNK4017: //cells statement not supported for the target platform; ignored
1>test.def(181): warning LNK4017: *addr[0] statement not supported for the target platform; ignored
1>test.def(182): warning LNK4017: *addr[1] statement not supported for the target platform; ignored
1>test.def(184): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(185): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(187): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(188): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(189): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(190): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(191): warning LNK4017: //Make statement not supported for the target platform; ignored
1>test.def(192): warning LNK4017: if(params[2] statement not supported for the target platform; ignored
1>test.def(193): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(194): warning LNK4017: cell* statement not supported for the target platform; ignored
1>test.def(196): warning LNK4017: //Get statement not supported for the target platform; ignored
1>test.def(197): warning LNK4017: amx_GetAddr(amx, statement not supported for the target platform; ignored
1>test.def(199): warning LNK4017: for(int statement not supported for the target platform; ignored
1>test.def(200): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(201): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(202): warning LNK4017: //You statement not supported for the target platform; ignored
1>test.def(203): warning LNK4017: //arithmetic statement not supported for the target platform; ignored
1>test.def(204): warning LNK4017: logprintf("arr[%d] statement not supported for the target platform; ignored
1>test.def(206): warning LNK4017: //If statement not supported for the target platform; ignored
1>test.def(207): warning LNK4017: //You statement not supported for the target platform; ignored
1>test.def(208): warning LNK4017: //to statement not supported for the target platform; ignored
1>test.def(210): warning LNK4017: // statement not supported for the target platform; ignored
1>test.def(211): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(212): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(213): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(214): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(216): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(217): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(218): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(219): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(220): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(221): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(223): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(224): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(225): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(226): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(227): warning LNK4017: float statement not supported for the target platform; ignored
1>test.def(228): warning LNK4017: x statement not supported for the target platform; ignored
1>test.def(229): warning LNK4017: y statement not supported for the target platform; ignored
1>test.def(230): warning LNK4017: z statement not supported for the target platform; ignored
1>test.def(232): warning LNK4017: //Get statement not supported for the target platform; ignored
1>test.def(233): warning LNK4017: if(g_Invoke->callNative(&PAWN::GetPlayerPos, statement not supported for the target platform; ignored
1>test.def(234): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(235): warning LNK4017: char statement not supported for the target platform; ignored
1>test.def(237): warning LNK4017: //Get statement not supported for the target platform; ignored
1>test.def(238): warning LNK4017: g_Invoke->callNative(&PAWN::GetPlayerName, statement not supported for the target platform; ignored
1>test.def(239): warning LNK4017: int statement not supported for the target platform; ignored
1>test.def(240): warning LNK4017: int statement not supported for the target platform; ignored
1>test.def(242): warning LNK4017: logprintf("%s statement not supported for the target platform; ignored
1>test.def(243): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(245): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(246): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(247): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(249): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(250): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(251): warning LNK4017: cell statement not supported for the target platform; ignored
1>test.def(252): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(253): warning LNK4017: //Get statement not supported for the target platform; ignored
1>test.def(254): warning LNK4017: char statement not supported for the target platform; ignored
1>test.def(255): warning LNK4017: g_Invoke->callNative(&PAWN::GetPlayerName, statement not supported for the target platform; ignored
1>test.def(257): warning LNK4017: //Check statement not supported for the target platform; ignored
1>test.def(258): warning LNK4017: if(string("Mario") statement not supported for the target platform; ignored
1>test.def(259): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(260): warning LNK4017: //If statement not supported for the target platform; ignored
1>test.def(261): warning LNK4017: g_Invoke->callNative(&PAWN::SendClientMessage, statement not supported for the target platform; ignored
1>test.def(262): warning LNK4017: g_Invoke->callNative(&PAWN::Kick, statement not supported for the target platform; ignored
1>test.def(263): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(264): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(265): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(268): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(269): warning LNK4017: //in statement not supported for the target platform; ignored
1>test.def(270): warning LNK4017: PLUGIN_EXPORT statement not supported for the target platform; ignored
1>test.def(271): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(272): warning LNK4017: //Note: statement not supported for the target platform; ignored
1>test.def(273): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(274): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(276): warning LNK4017: //The statement not supported for the target platform; ignored
1>test.def(277): warning LNK4017: //will statement not supported for the target platform; ignored
1>test.def(278): warning LNK4017: PLUGIN_EXPORT statement not supported for the target platform; ignored
1>test.def(279): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(280): warning LNK4017: //allocate statement not supported for the target platform; ignored
1>test.def(281): warning LNK4017: g_Invoke statement not supported for the target platform; ignored
1>test.def(283): warning LNK4017: //Assign statement not supported for the target platform; ignored
1>test.def(284): warning LNK4017: pAMXFunctions statement not supported for the target platform; ignored
1>test.def(285): warning LNK4017: logprintf statement not supported for the target platform; ignored
1>test.def(287): warning LNK4017: logprintf("* statement not supported for the target platform; ignored
1>test.def(288): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(289): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(291): warning LNK4017: //Unload statement not supported for the target platform; ignored
1>test.def(292): warning LNK4017: PLUGIN_EXPORT statement not supported for the target platform; ignored
1>test.def(293): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(294): warning LNK4017: logprintf("* statement not supported for the target platform; ignored
1>test.def(295): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(297): warning LNK4017: //Our statement not supported for the target platform; ignored
1>test.def(298): warning LNK4017: AMX_NATIVE_INFO statement not supported for the target platform; ignored
1>test.def(299): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(300): warning LNK4017: {"PrintPawnString", statement not supported for the target platform; ignored
1>test.def(301): warning LNK4017: {"PrintPawnString2", statement not supported for the target platform; ignored
1>test.def(302): warning LNK4017: {"SetPawnString", statement not supported for the target platform; ignored
1>test.def(303): warning LNK4017: {"ReturnPawnFloatVal", statement not supported for the target platform; ignored
1>test.def(304): warning LNK4017: {"SetPawnReferenceVars", statement not supported for the target platform; ignored
1>test.def(305): warning LNK4017: {"PrintPawnArray", statement not supported for the target platform; ignored
1>test.def(306): warning LNK4017: {"EmitPawnCallback", statement not supported for the target platform; ignored
1>test.def(307): warning LNK4017: {"WhereIsPlayer", statement not supported for the target platform; ignored
1>test.def(308): warning LNK4017: {"Invoke_GetAddresses", statement not supported for the target platform; ignored
1>test.def(309): warning LNK4017: {"TEST_Hook_OnPlayerConnnect", statement not supported for the target platform; ignored
1>test.def(310): warning LNK4017: {0, statement not supported for the target platform; ignored
1>test.def(311): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(313): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(314): warning LNK4017: //a statement not supported for the target platform; ignored
1>test.def(315): warning LNK4017: //native statement not supported for the target platform; ignored
1>test.def(316): warning LNK4017: PLUGIN_EXPORT statement not supported for the target platform; ignored
1>test.def(317): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(318): warning LNK4017: //Any statement not supported for the target platform; ignored
1>test.def(319): warning LNK4017: g_Invoke->amx_list.push_back(amx) statement not supported for the target platform; ignored
1>test.def(320): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(321): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(323): warning LNK4017: //This statement not supported for the target platform; ignored
1>test.def(324): warning LNK4017: //non-existing statement not supported for the target platform; ignored
1>test.def(325): warning LNK4017: PLUGIN_EXPORT statement not supported for the target platform; ignored
1>test.def(326): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(327): warning LNK4017: //Every statement not supported for the target platform; ignored
1>test.def(328): warning LNK4017: //unloaded, statement not supported for the target platform; ignored
1>test.def(329): warning LNK4017: for(list<AMX statement not supported for the target platform; ignored
1>test.def(330): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(331): warning LNK4017: if(*i statement not supported for the target platform; ignored
1>test.def(332): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(333): warning LNK4017: g_Invoke->amx_list.erase(i) statement not supported for the target platform; ignored
1>test.def(334): warning LNK4017: break statement not supported for the target platform; ignored
1>test.def(335): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(336): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(337): warning LNK4017: return statement not supported for the target platform; ignored
1>test.def(338): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(340): warning LNK4017: //ProcessTick statement not supported for the target platform; ignored
1>test.def(341): warning LNK4017: //keeping statement not supported for the target platform; ignored
1>test.def(342): warning LNK4017: // statement not supported for the target platform; ignored
1>test.def(343): warning LNK4017: //PAWN statement not supported for the target platform; ignored
1>test.def(344): warning LNK4017: PLUGIN_EXPORT statement not supported for the target platform; ignored
1>test.def(345): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(346): warning LNK4017: static statement not supported for the target platform; ignored
1>test.def(347): warning LNK4017: const statement not supported for the target platform; ignored
1>test.def(349): warning LNK4017: tick++ statement not supported for the target platform; ignored
1>test.def(351): warning LNK4017: //Use statement not supported for the target platform; ignored
1>test.def(352): warning LNK4017: if(!(tick statement not supported for the target platform; ignored
1>test.def(353): warning LNK4017: { statement not supported for the target platform; ignored
1>test.def(354): warning LNK4017: //If statement not supported for the target platform; ignored
1>test.def(355): warning LNK4017: const statement not supported for the target platform; ignored
1>test.def(356): warning LNK4017: g_Invoke->callNative(&PAWN::SendClientMessageToAll, statement not supported for the target platform; ignored
1>test.def(357): warning LNK4017: } statement not supported for the target platform; ignored
1>test.def(357): warning LNK4017: } statement not supported for the target platform; ignored
1>     Creating library c:\users\edvin\documents\visual studio 2010\Projects\createclan\Debug\createclan.lib and object c:\users\edvin\documents\visual studio 2010\Projects\createclan\Debug\createclan.exp
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I've include SDK includes (pic):


Can anyone helps me?
Edvin is offline   Reply With Quote
Old 26/05/2013, 02:01 PM   #86
xeeZ
Huge Clucker
 
Join Date: Feb 2013
Posts: 317
Reputation: 382
Default Re: Plugin development guide

Rename test.def to test.cpp
xeeZ is offline   Reply With Quote
Old 26/05/2013, 06:32 PM   #87
Edvin
Gangsta
 
Edvin's Avatar
 
Join Date: Dec 2010
Posts: 868
Reputation: 71
Default Re: Plugin development guide

Quote:
Originally Posted by xeeZ View Post
Rename test.def to test.cpp
I don't have that errors now, but now i have:
Code:
1>LINK : fatal error LNK1104: cannot open file 'test.def'
EDIT: Solved.

Last edited by Edvin; 27/05/2013 at 05:55 PM.
Edvin is offline   Reply With Quote
Old 09/06/2013, 08:29 PM   #88
Manowar
Banned
 
Join Date: Jul 2012
Posts: 122
Reputation: -8
Default Re: Plugin development guide

delete niggas

Last edited by Manowar; 09/06/2013 at 08:55 PM. Reason: dellete message
Manowar is offline   Reply With Quote
Old 08/07/2013, 03:26 PM   #89
Isolated
Gangsta
 
Isolated's Avatar
 
Join Date: Mar 2013
Location: United Kingdom
Posts: 837
Reputation: 143
Default Re: Plugin development guide

would I be able to use:

Code:
CallNative(&PAWN::mysql_connect, RAWR, RAWR, RAWR, RAWR); // For example.

Without the g_Invoke, or will I need to add it ?
Isolated is offline   Reply With Quote
Old 13/07/2013, 01:30 AM   #90
RebeloX
High-roller
 
RebeloX's Avatar
 
Join Date: Jul 2011
Location: Portugal
Posts: 2,261
Reputation: 442
Default Re: Plugin development guide

Hello, i'm using devc++ can i use the same code?
__________________
RebeloX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SA-MP 0.3c in development Kalcor News and Updates 889 19/09/2014 04:39 PM
0.3b Development bar gone WackoX General 94 02/08/2010 10:17 PM
A guide to install Jacob's IRC plugin? Celson Server Support 5 09/06/2009 07:06 AM


All times are GMT. The time now is 08:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.