undefined symbol "split"
#1

Why This Happening?

Код:
HS.pwn(94) : error 017: undefined symbol "split"
The Code

pawn Код:
#include <a_samp>

enum hInfo
{
Float:hExteriorX,
Float:hExteriorY,
Float:hExteriorZ,
Float:hInteriorX,
Float:hInteriorY,
Float:hInteriorZ,
hInterior,
hVirtualWorld,
hOwned,
hOwner[MAX_PLAYER_NAME],
hDescription[MAX_PLAYER_NAME],
hPrice,
hPickup,
};
new HouseInfo[1000][hInfo];

public OnFilterScriptInit()
{
LoadHouse();
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/henter", true) == 0)
{
for(new houseid = 0; houseid < sizeof(HouseInfo); houseid++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]))
{
SetPlayerPos(playerid,  HouseInfo[houseid][hInteriorX],  HouseInfo[houseid][hInteriorY],  HouseInfo[houseid][hInteriorZ]);
SetPlayerInterior(playerid, HouseInfo[houseid][hInterior]);
SetPlayerVirtualWorld(playerid, HouseInfo[houseid][hVirtualWorld]);
}
}
return 1;
}
return 0;
}

stock SaveHouse()
{
new houseid;
new File:file2;
while (houseid < sizeof(HouseInfo))
{
new coordsstring[128];
format(coordsstring, sizeof(coordsstring), "%f, %f, %f, %f, %f, %f, %d, %d, %s, %s, %d, %d, %d\n",

HouseInfo[houseid][hExteriorX],
HouseInfo[houseid][hExteriorY],
HouseInfo[houseid][hExteriorZ],
HouseInfo[houseid][hInteriorX],
HouseInfo[houseid][hInteriorY],
HouseInfo[houseid][hInteriorZ],
HouseInfo[houseid][hInterior],
HouseInfo[houseid][hVirtualWorld],
HouseInfo[houseid][hOwned],
HouseInfo[houseid][hOwner],
HouseInfo[houseid][hDescription],
HouseInfo[houseid][hPrice],
HouseInfo[houseid][hPickup];

if(houseid == 0)
{
file2 = fopen("Houses.ini", io_write);
}
else
{
file2 = fopen("Houses.ini", io_append);
}
fwrite(file2, coordsstring);
houseid++;
fclose(file2);
}
return 1;
}

stock LoadHouse()
{
new arrCoords[22][64];
new strFromFile2[128];
new File: file = fopen("Houses.ini", io_read);
if (file)
{
new houseid;
while (houseid < sizeof(HouseInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ','); //<<<<<<<<<<<THIS<<<<<<THIS

HouseInfo[houseid][hExteriorX] = floatstr(arrCoords[0]);
HouseInfo[houseid][hExteriorY] = floatstr(arrCoords[1]);
HouseInfo[houseid][hExteriorZ] = floatstr(arrCoords[2]);
HouseInfo[houseid][hInteriorX] = floatstr(arrCoords[3]);
HouseInfo[houseid][hInteriorY] = floatstr(arrCoords[4]);
HouseInfo[houseid][hInteriorZ] = floatstr(arrCoords[5]);
HouseInfo[houseid][hInterior] = strval(arrCoords[6]);
HouseInfo[houseid][hVirtualWorld] = strval(arrCoords[7]);
HouseInfo[houseid][hOwned] = strval(arrCoords[8]);
strmid(HouseInfo[houseid][hOwner], arrCoords[9], 0, strlen(arrCoords[9]), 255);
strmid(HouseInfo[houseid][hDescription], arrCoords[10], 0, strlen(arrCoords[10]), 255);
HouseInfo[houseid][hPrice] = strval(arrCoords[11]);
HouseInfo[houseid][hPickup] = strval(arrCoords[12]);

if(HouseInfo[houseid][hOwned] == 0)
{
HouseInfo[houseid][hPickup] = CreatePickup(1273, 1, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ], 0);
}
else if(HouseInfo[houseid][hOwned] == 1)
{
HouseInfo[houseid][hPickup] = CreatePickup(1239, 1, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ], 0);
}
if(!strlen(HouseInfo[houseid][hOwner]))
{
strmid(HouseInfo[houseid][hOwner], "The State", 0, 10, 255);
}
houseid++;
}
fclose(file);
}
return 1;
}
Advise Thanks, And If You Have Time Please Explain Why
Reply
#2

Код:
stock split(const strsrc[], strdest[][], delimiter)
{
	new i, li;
	new aNum;
	new len;
	while(i <= strlen(strsrc)){
	    if(strsrc[i]==delimiter || i==strlen(strsrc)){
	        len = strmid(strdest[aNum], strsrc, li, i, 128);
	        strdest[aNum][len] = 0;
	        li = i+1;
	        aNum++;
		}
		i++;
	}
	return 1;
}
Reply
#3

removed.............
Reply
#4

Thank You
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)