SA-MP Forums Archive
Help me to fix this errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me to fix this errors (/showthread.php?tid=523722)



Help me to fix this errors - Suresh - 03.07.2014

I want to fix this error in my admin system pls help me.

Код:
#include <a_samp>
#include <core>
#include <float>
#include <string>
#include <file>
#include <time>
#include <a_players>
#include <a_vehicles>
#include <a_objects>
#include <dini>
#include <sscanf>
#include <strlib>
Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

Errors while compiling
Код:
F:\server\Cops and robbers\arjanzadmin.pwn(274) : error 021: symbol already defined: "strtok"



Re: Help me to fix this errors - kamiliuxliuxliux - 03.07.2014

strtok is already defined. Delete whole stock function.


Re: Help me to fix this errors - Blademaster680 - 03.07.2014

Quote:

strtok is already defined. Delete all stock function.

Yeah you probably find it was defined in a include or something you are using. You dont need that function there. So therefore you can remove it


Re: Help me to fix this errors - Suresh - 03.07.2014

After removing strok its showing like this

Код:
F:\server\Cops and robbers\arjanzadmin.pwn(2133) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2184) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2233) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2384) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2386) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2420) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2422) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2456) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2486) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2490) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2521) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2574) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(2764) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(3742) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(3759) : error 047: array sizes do not match, or destination array is too small
F:\server\Cops and robbers\arjanzadmin.pwn(3834) : error 047: array sizes do not match, or destination array is too small
Код:
	if(PlayerVal[playerid][VLvlAdmin] >= 3)
	    {
	        new tmp[128];
     		tmp = strtok(cmdtext, idx);
	        if(!strlen(tmp))
	        {
         		if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ORANGE, VhFix_PlNOV);



Re: Help me to fix this errors - kamiliuxliuxliux - 03.07.2014

Holly molly! Now I can't help

EDIT: But I have a suggestion, that you better use ZCMD, instead of strtoks in OnPlayerCommandText. With ZCMD you can easily make command params and most of scripters use this method.



Re: Help me to fix this errors - Dziugsas - 03.07.2014

Deleting this tmp = strtok(cmdtext, idx); everywhere.