05.12.2016, 19:26
Guys, what i have to do to cmd setlevel modify score of player. So score = level you know.
i use this
i use this
PHP код:
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Skin",PlayerInfo[playerid][pSkin]);
INI_Int("Level",PlayerInfo[playerid][pLevel]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
INI_Close(File);
return 1;
}
CMD:setskin(playerid, params[])
{
new pID, value;
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "{FF0000}EROARE: {FFFFFF}Nu ai acces la aceasta comanda.");
else if(sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COLOR_GOLD, "Foloseste: /setskin [id] [skin]");
else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_TOM, "Jucatorul nu este conectat.");
else if(value < 0 || value > 311) return SendClientMessage(playerid, COLOR_GOLD, "Skinuri valabile: 0-311.");
else
{
new string[100], target[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(pID, target, sizeof(target));
format(string, sizeof(string), "I-ai setat lui "COL_YELLOW"%s "COL_GY"skin-ul "COL_YELLOW"%i.", target, value);
SendClientMessage(playerid, COLOR_GYELLOW, string);
format(string, sizeof(string), "Skinul tau este acum "COL_YELLOW"%i "COL_GY"datorita lui "COL_YELLOW"%s.", value, pName);
SendClientMessage(pID, COLOR_GYELLOW, string);
PlayerInfo[pID][pSkin] = value;
SetPlayerSkin(pID, PlayerInfo[pID][pSkin]);
}
return 1;
}