Get Strings in file and connect it to other file
#1

Sorry for bad English
I want to do this:
Get String from pFile (btw this line is error line... i think i need to add strcmp or something)
pawn Код:
DOF2_GetString(pFile(playerid),"Clan");
then its will Get the String "Clan = X" from pFile and I want to make cFile as "Clan"'s String (Clan = X)
so X will be the cFile
pawn Код:
DOF2_GetString(cFile(playerid),"Color");
now i got "Color = 0xFF0000FF" at cFile file
so I want to do:
OnPlayerSpawn
SetPlayerColor(playerid,DOF2_GetString(cFile(playe rid),"Color");

my stocks:

pawn Код:
stock pFile(playerid)
{
new pName[MAX_PLAYER_NAME +1];
new File[50];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(File,sizeof(File),"Accounts/%s.ini",pName);
return File;
}
pawn Код:
stock cFile(playerid)
{
new File[50];
format(File,sizeof(File),"Clans/%s.ini",cString);
SetPlayerScore(playerid,0);
return File;
}
Please help
Reply
#2

Try to use DOF2_GetHex and DOF2_SetHex to color...
Reply
#3

Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
Try to use DOF2_GetHex and DOF2_SetHex to color...
Sounds nice, can you explain me about Set/Get Hex?
IDK how to work with it, never used it before
Reply
#4

Is like DOF2_SetInt, DOF2_GetString,etc. But it save/load and hexadecimal number...
Reply
#5

pawn Код:
CMD:clancreate(playerid,params[]){
if(AdminLevel <5)return MSG(playerid,C_RED,"[ERROR] {FF6969}You not allowed to use this command!");
if(sscanf(params,"s",cString)) return MSG(playerid,C_RED,"[ERROR] {ff6969}USAGE: /CLANCREATE <CLAN NAME>");
format(cString,sizeof(cString),cString);
DOF2_CreateFile(cFile(playerid));
DOF2_SetHex(cFile(playerid),"Color",0xFF0000FF);
DOF2_SetInt(cFile(playerid),"Level",0);
DOF2_SetInt(cFile(playerid),"Kills",0);
DOF2_SetInt(cFile(playerid),"Deaths",0);
DOF2_SetInt(cFile(playerid),"Heroin",0);
DOF2_SetInt(cFile(playerid),"Money",0);
DOF2_SetInt(cFile(playerid),"WarehouseLvl",0);
DOF2_SetInt(cFile(playerid),"WarehouseX",0);
DOF2_SetInt(cFile(playerid),"WarehouseY",0);
DOF2_SetInt(cFile(playerid),"WarehouseZ",0);
MSG(playerid,C_GREEN,"Done");
 return 1;}
pawn Код:
SetPlayerColor(playerid,DOF2_GetHex(cFile(playerid),"Color"));
like this? my color is still black... and the hex in the clan file is 0xFF0000FF
Reply
#6

Get rid of this old library, and use some new thing like Y_INI, MySQL, SQLite, ...
Reply
#7

Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
Try to use DOF2_GetHex and DOF2_SetHex to color...
Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
Is like DOF2_SetInt, DOF2_GetString,etc. But it save/load and hexadecimal number...
Quote:
Originally Posted by iFarbod
Посмотреть сообщение
Get rid of this old library, and use some new thing like Y_INI, MySQL, SQLite, ...
idk to use them
Reply
#8

How are you using DOF2_GetHex ?
Reply
#9

Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
How are you using DOF2_GetHex ?
take a look on my privous reply
i typed for you...
Reply
#10

If the file is saving correctly, try this
pawn Код:
SetPlayerColor(playerid,DOF2_GetHex(cFile(playerid),"Color") >>> 8);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)