14.11.2010, 23:22
Uso esse comando aq de Setlevel:
dcmd_setlevel(playerid, params[])
Tudo funfa de boa. Mostra a string de quem mudou o level, de quem foi mudado e o level escolhido, tudo perfeito. O problema й que quando mudo o level, o level de quem foi mudado nгo altera no arquivo dini, so quando ele disconnect, que tem la:
Nгo tem como salvar assim que muda с ? =SS
dcmd_setlevel(playerid, params[])
Код:
{ new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(!strlen(params)) return SendClientMessage(playerid, VERMELHO, "USAGE: /setlevel [playerid] [level]"); new player1, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, playername, MAX_PLAYER_NAME); GetPlayerName(playerid, adminname, MAX_PLAYER_NAME); player1 = strval(tmp); level = strval(tmp2); if(!strlen(tmp2)) return SendClientMessage(playerid, VERMELHO, "USAGE: /setlevel [playerid] [level]"); if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, VERMELHO, "Player nгo conectado"); if(level > MAX_LEVEL) return SendClientMessage(playerid, VERMELHO, "Level maximo й 100. Escolha igual ou menor a 100"); format(string,sizeof(string),"ADMIN: %s mudou o level de %s para %d", adminname, playername, level); dUserSetINT(PlayerName2(player1)).("Level",(level)); PlayerInfo[player1][Level] = level; dUserSetINT(PlayerName2(player1)).("Level",(level)); PlayerInfo[player1][Level] = level; return SendClientMessageToAll(BRANCO, string); }
Код:
public OnPlayerDisconnect(playerid, reason) { new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(gPlayerLogged[playerid] == 1) { dini_IntSet(file, "Score", GetPlayerScore(playerid)); dini_IntSet(file, "Money", GetPlayerMoney(playerid)); dini_IntSet(file, "level", PlayerInfo[playerid][Level]); dini_IntSet(file, "Cold", PlayerInfo[playerid][Cold]); dini_IntSet(file, "Hot", PlayerInfo[playerid][Hot]); } gPlayerLogged[playerid] = 0; return 1; }