Help me to fix this errors
#1

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"
Reply
#2

strtok is already defined. Delete whole stock function.
Reply
#3

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
Reply
#4

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);
Reply
#5

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.
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)