Problem with split
#1

Hey, this is the split function to those unfamiliar with it:
PHP код:
public split(const strsrc[], strdest[][], delimiter)
{
    new 
ili;
    new 
aNum;
    new 
len;
    while(
<= strlen(strsrc)){
        if(
strsrc[i]==delimiter || i==strlen(strsrc)){
            
len strmid(strdest[aNum], strsrclii128);
            
strdest[aNum][len] = 0;
            
li i+1;
            
aNum++;
        }
        
i++;
    }
    return 
1;

Now I tried to do this:
PHP код:
        new Parts[3][52];
            
split(mysql_Float(SQL_USERS,PlayerInfo[playerid][pUID],"spawn"), Parts','); 
And this is the error it puts out:
PHP код:
C:\Users\Mark\Desktop\GRP.pwn(350) : error 035argument type mismatch (argument 1)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error

Reply
#2

Cause I am not quite comfortable with using sscanf, I don't know why really. I'll try and look through it again though, thanks.
Reply
#3

Did it with sscanf:
PHP код:
            sscanf(mysql_Int(SQL_USERS,PlayerInfo[playerid][pUID],"spawn"),"p<,>fff"PlayerInfo[playerid][pSpawn][0], PlayerInfo[playerid][pSpawn][1],PlayerInfo[playerid][pSpawn][2]); 
Still writes the same error, here is mysql_Int:
PHP код:
stock mysql_Get(table[],id,key[])
{
    new 
string[128];
    
format(stringsizeof(string), "SELECT `%s` FROM `%s` WHERE `id` = '%d'",key,table,id);
    
mysql_query(string);
        
mysql_store_result();
        
mysql_fetch_row_format(string);
    return 
string;

mysql_int is just calling mysql_Get and converting it into integers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)