[Help] Writing and Reading from INI
#1

[font=Courier New] I am new to pawno scripting. I want to write players skin ID in file and then read from it.
For example:

1] Suppose im wearing grove skin. When i type /copduty. My skin changes to Cop skin and my previous skin (grove skin) gets saved in the file.

2] When i type /offduty. My Cop skin disappears and changes to previous skin (grove skin).

If someone can just give me code of writing and reading the skin from the file. That will be enough for me to understand.

-Lastman
Reply
#2

Search for dini.
Reply
#3

But he wants ini.. ><

Use player enum, make it save by checking the player enum when you login/register/update.
On /duty you set the skin to what you want, on /offduty you set it to the skin from the player enum.
Like
pawn Код:
SetPlayerSkin(playerid,skin[playerid]); // If you don't do it in an enum
//if you do use it like
SetPlayerSkin(playerid,enumname[playerid][skin]);
Reply
#4

[font=courier new] Alright. I found a topic on this forum about DINI.

But i did not understood it well. Norn could you help me with this ? I made the code but i think its pretty wrong :

dini_Set("skinsave/file.ini", "GetPlayerNameEx(playerid)", "GetPlayerSkin(playerid)");

string = dini_Get("skinsave/file.ini", "samp");
if(strcmp(string, "GetPlayerNameEx(playerid)", false) == 0)
{
SetPlayerSkin(string)
}
Reply
#5

[font=courier new]bump please help, writing and reading from INI. I need very simple code of writing in INI (playername = skinid) and reading the skin id. please help
Reply
#6

I don't know dini well..
But I already helped you with ini though.
What's GetPlayerNameEx?
Reply
#7

Quote:
Originally Posted by MenaceX^
What's GetPlayerNameEx?
If its the one im thinking of then it removes/replaces the _ in the players name
Reply
#8

Quote:
Originally Posted by MenaceX^
But he wants ini.. ><

Use player enum, make it save by checking the player enum when you login/register/update.
On /duty you set the skin to what you want, on /offduty you set it to the skin from the player enum.
Like
pawn Код:
SetPlayerSkin(playerid,skin[playerid]); // If you don't do it in an enum
//if you do use it like
SetPlayerSkin(playerid,enumname[playerid][skin]);
And thats what dini is.. It's a script for ini files.
Reply
#9

Quote:
Originally Posted by JeNkStAX
Quote:
Originally Posted by MenaceX^
What's GetPlayerNameEx?
If its the one im thinking of then it removes/replaces the _ in the players name
Yeah but I'd like to know if it's mine of it's from Carlitos rp
Reply
#10

But guys can you just give me an example code of very simple writing (playerid=skinid) and then reading skin id. I just need that code to understand
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)