01.06.2011, 09:28
hey I need help with this thing:
I need to get the var of vehicle number that I will use by new vehicleid = strval(tmp);
in command and by the playerid that I will use like the new vehicleid
and the problem is that it gives me price 0 when in the file it's 500
can someone help me fix this stock?
PHP код:
stock checkprice(playerid,vehicleid)
{
new string[256];
new File: UserFile = fopen("vprices.ini", io_read);
if (UserFile)
{
new key[256] , val[ 256 ];
new Data[256];
while (fread(UserFile,Data, sizeof(Data)))
{
key = ini_GetKey( Data );
format(string,sizeof(string),"%s",vehicleid);
if(strcmp(key,string,true)==0) { val = ini_GetValue(Data); pCarPrice[playerid] = strval(val); }
}
fclose(UserFile);
}
//pCarPrice[plaid] = dini_Int("vprices.cfg", id);
return 1;
}
in command and by the playerid that I will use like the new vehicleid
and the problem is that it gives me price 0 when in the file it's 500
can someone help me fix this stock?