12.07.2015, 08:43
Hey I'm still struggling with code I'm trying to do, what I'm trying to do is save player's crimes and load them..
What I tried is this:
It saves the crime but can't load it :S
What I tried is this:
pawn Код:
CMD:makewanted(playerid,params[])
{
new id, reason[80], string[50];
PlayerInfo[playerid][Crime] = reason[70];
if(sscanf(params, "us[80]",id ,reason)) return SendClientMessage(playerid,-1,"USAGE: /report <PlayerID/Part of Name> <Reason>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Player Not connected");
new INI:File = INI_Open(UserPath(playerid));
INI_WriteString(File,"Crimes",reason);
INI_Close(File);
format(string, sizeof(string), "Crime %s saved", reason);
SendClientMessage(playerid, -1, string);
return 1;
}
CMD:wanted(playerid,params[])
{
new string[128];
new INI:File = INI_Open(UserPath(playerid));
format(string, sizeof(string), "Your current crimes: %s", PlayerInfo[playerid][Crime]);
SendClientMessage(playerid, -1, string);
INI_Close(File);
return 1;
}