12.04.2011, 13:57
Galera Eu Seto Um Cara De Level 5 de CV Quando Ele Sai do Jogo e Entra Ele Vai Pra Level 1 ? Podem Me Ajudar?
Код:
if(strcmp(cmd, "/setcv", true) == 0) { tmp = strtok(cmdtext, idx); giveplayerid = strval(tmp); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[playerid][pCV] = dini_Int(udb_encode(sendername), "levelcv"); PlayerInfo[giveplayerid][pCV] = dini_Int(udb_encode(giveplayer), "levelcv"); giveplayerid = strval(tmp); if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 5) { SendClientMessage(playerid, COLOR_GREEN, "Uso correto: /setcv [id do player] [cargo]"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 5) { SendClientMessage(playerid, COLOR_GREEN, "Uso correto: /setcv [id do player] [cargo]"); return 1; } PlayerInfo[playerid][pCV] = dini_Int(udb_encode(sendername), "levelcv"); levelcv[playerid] = strval(tmp); if(levelcv[playerid] < 0) { SendClientMessage(playerid, COLOR_CYAN, "Level de CV invбlido!"); return 1; } if(levelcv[playerid] > 5) { SendClientMessage(playerid, COLOR_CYAN, "Level de CV invбlido!"); return 1; } if(levelcv[playerid] == PlayerInfo[giveplayerid][pCV]) { format(string, sizeof(string), "Este player jб й um membro do CV!", levelcv[playerid]); SendClientMessage(playerid, COLOR_CYAN, string); return 1; } if(logged[playerid] == 1) { if(PlayerInfo[playerid][pAdmin] >= 5 || PlayerInfo[playerid][pCV] >= 3) { if(IsPlayerConnected(giveplayerid)) { if(logged[giveplayerid] == 0) { SendClientMessage(playerid, COLOR_CYAN, "O player tem que estar logado para poder receber o level de CV!"); return 1; } else { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); dini_IntSet(udb_encode(giveplayer), "levelcv", levelcv[playerid]); format(string, sizeof(string), "ADMIN: Vocк tranformou o player %s em um membro do CV!", giveplayer); SendClientMessage(playerid, COLOR_CYAN, string); format(string, sizeof(string), "ADMIN: Agora vocк й membro do CV level %d, Promovido por %s.", level[playerid], sendername, playerid); SendClientMessage(giveplayerid, COLOR_CYAN, string); PlayerInfo[giveplayerid][pCV] = dini_Int(udb_encode(giveplayer), "levelcv"); new PlayerName[30]; GetPlayerName(playerid, PlayerName, 30); printf("[Command] %s usou /setcv para dar par %s level %d de CV.", PlayerName, giveplayer, level[playerid]); } } else { format(string, sizeof(string), "%d nгo й o nъmero de ID de um player ativo!", giveplayerid); SendClientMessage(playerid, COLOR_CYAN, string); } } else { SendClientMessage(playerid, COLOR_CYAN, "Vocк nгo tem permissгo para usar este comando!"); } } else { SendClientMessage(playerid, COLOR_CYAN, "Vocк tem que estar logado para usar este comando!"); } return 1; }