15.08.2012, 20:43
This will probably give you some errors, but I hope you can fix them yourself.
However, it would be better to store all user data in variables until they disconnect, and then do all the saves.
pawn Код:
public OnAgeGiven(playerid, Age) //Age as integer, not string
{
new string2[64];
format(string2, sizeof(string2), "users/%s.ini", GetPlayerNameEx(playerid));
if(!fexist(string2))
return SendCliendMessage(playerid, -1, "The impossible has happened, your account does not exist! Notify Administrator.");
else
{
new File:example = fopen(string2, io_append);
if(example)
{
new ap[32];
format(ap, 32, "Age=%s\n", Age);
fwrite(example, ap);
fclose(example);
SendClientMessage(playerid, COLOR_RED, "Step 2 Completed!");
SetPlayerCameraPos(playerid, -2274.2588,110.6220,66.7716);
SetPlayerCameraLookAt(playerid, -2309.3486,105.3977,35.5809);
PlayerInfo[playerid][pAge] = Age;
ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Religon","Jewish\nMuslim\nChristian\nCatholic\nIslam\nHindu\nBuddist\nAtheist","Continue","Cancel");
}
}
return 1;
}