08.04.2012, 09:18
it wont write a thing in the data
please need help
but when i ride the LSPD vehicle it can ride but when i relog
it cant ride and the thing on the data is all 0
#define LSPD 1
please need help
but when i ride the LSPD vehicle it can ride but when i relog
it cant ride and the thing on the data is all 0
#define LSPD 1
pawn Код:
#define PATH "/Users/%s.ini"
enum pInfo
{
pLeader,
pMember,
pType,
}
new pData[MAX_PLAYERS][pInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Leader",pData[playerid][pLeader]);
INI_Int("Member",pData[playerid][pMember]);
INI_Int("Type",pData[playerid][pType]);
return 1;
}
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}
else
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Leader",0);
INI_WriteInt(File,"Member",0);
INI_WriteInt(File,"Type",0);
INI_Close(File);
}
return 1;
}
CMD:setleader(playerid,params[])
{
new id,factionid;
new fname[128],string[500];
if(sscanf(params,"ud",id,factionid)) return SendClientMessage(playerid,C_WHITE,"USAGE: /setleader [ Name / ID ] [ Faction ID ]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,C_RED,"[ Error ]:"CWHITE" Player not Connected");
switch(factionid)
{
case 1: fname = ""CBLUE"Los Santos Police Department";
case 2: fname = "Unknown Faction";
}
format(string,sizeof(string),"You have set %s as a leader in %s",PlayerName(id),fname);
SendClientMessage(playerid,C_WHITE,string);
pData[playerid][pLeader] = factionid;
return 1;
}
CMD:now(playerid)
{
SetPlayerPos(playerid,1523.0228,-1683.5563,13.5469);
return 1;
}