How is pVeh[4] stored in mysql?
#14

Quote:

cache_get_value(0, "Elite", pEliteString[playerid]);
new ch[5] = ";";
new d = 0;
while(pEliteString[playerid][d] != EOS)
{
if(!strcmp(pEliteString[playerid][d], ch)) printf("pEliteString every char that isn't ch var: ", pEliteString[playerid][d]);
d++;
}

That was my idea

BTW, you're comparing a character with a string. You could just use the == operator for that.

PHP код:
new ch ';';
if(
pEliteString[playerid][d] == ch//do something. 
btw, you don't have to hassle around that, you could just use the split function with delemiter ";", like shown below

PHP код:
stock split(const src[], dest[][], const delimiter//Define this function somewhere else, found at sa-mp wiki
{
    new 
n_pos,num,old,str[1];
    
str[0] = delimiter;
    while(
n_pos != -1)
    {
        
n_pos strfind(src,str,false,n_pos+1);
        
strmid(dest[num++], src, (!num)?0:old+1,(n_pos==-1)?strlen(src):n_pos,256);
        
old=n_pos;
    }
    return 
1;
}


new 
output[20][1]; // 20 == number of maximum ";" would apper, 1 == size of the string between each ";" (in this case it seem to be just 1 or 0, so just defined as 1 at max.

split(pEliteString[playerid],output,';'); 
Reply


Messages In This Thread
How is pVeh[4] stored in mysql? - by Saddin - 06.05.2017, 10:56
Re: How is pVeh[4] stored in mysql? - by Vince - 06.05.2017, 11:17
Re: How is pVeh[4] stored in mysql? - by coool - 06.05.2017, 11:20
Re: How is pVeh[4] stored in mysql? - by ShihabSoft - 06.05.2017, 11:28
Re: How is pVeh[4] stored in mysql? - by Saddin - 06.05.2017, 11:34
Re: How is pVeh[4] stored in mysql? - by ShihabSoft - 06.05.2017, 11:36
Re: How is pVeh[4] stored in mysql? - by Saddin - 06.05.2017, 11:39
Re: How is pVeh[4] stored in mysql? - by ShihabSoft - 06.05.2017, 11:52
Re: How is pVeh[4] stored in mysql? - by Vince - 06.05.2017, 11:54
Re: How is pVeh[4] stored in mysql? - by Saddin - 06.05.2017, 12:00
Re: How is pVeh[4] stored in mysql? - by coool - 06.05.2017, 12:03
Re: How is pVeh[4] stored in mysql? - by Saddin - 06.05.2017, 12:08
Re: How is pVeh[4] stored in mysql? - by Saddin - 06.05.2017, 22:49
Re: How is pVeh[4] stored in mysql? - by ShihabSoft - 07.05.2017, 04:41
Re: How is pVeh[4] stored in mysql? - by Saddin - 07.05.2017, 11:03
Re: How is pVeh[4] stored in mysql? - by ShihabSoft - 07.05.2017, 11:05
Re: How is pVeh[4] stored in mysql? - by Saddin - 07.05.2017, 11:09
Re: How is pVeh[4] stored in mysql? - by Vince - 07.05.2017, 11:44
Re: How is pVeh[4] stored in mysql? - by Saddin - 07.05.2017, 12:23

Forum Jump:


Users browsing this thread: 1 Guest(s)