07.10.2011, 00:23
Eu estava tentando fazer um sistema de avisos para administradores, se o administrador receber 3 avisos ele perderб o admin automaticamente. e eu queria saber o que hб de errado com esse comando
Meu pInfo
Se vocкs poderem me ajudar eu ficarei muito agradecido
vlw
Код:
if(strcmp(cmd, "/admaviso", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /admaviso [ id ] [reason]"); return 1; } giveplayerid = ReturnUser(tmp); if (PlayerInfo[playerid][pAdmin] >= 1337) } if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /aviso [ id ] [reason]"); return 1; } PlayerInfo[giveplayerid][pAwarns] += 1; if(PlayerInfo[giveplayerid][pAwarns] >= 3) { new year, month,day; getdate(year, month, day); format(string, sizeof(string), "ADMIN CMD: %s foi expulso de admin por %s, Motivo: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year); format(string, sizeof(string), "ADMIN CMD: %s foi expulso de admin por %s (Tinha 3 Avisos), Motivo: %s", giveplayer, sendername, (result)); SendClientMessageToAll(COLOR_LIGHTRED, string); strmid(PlayerInfo[giveplayerid][pMotivo], "Acъmulo de 3 avisos", 0, strlen("Acъmulo de 3 avisos"), 255); strmid(PlayerInfo[giveplayerid][pAdminName], GetName(playerid), 0, strlen(GetName(playerid)), 255); PlayerInfo[giveplayerid][pAdmin] = 0; return 1; } new year, month,day; getdate(year, month, day); format(string, sizeof(string), "ADMIN CMD: %s Voce levou um aviso do administrador %s, Motivo: %s, Data: %d/%d/%d", giveplayer, sendername, (result),month,day,year); SendClientMessageToAll(COLOR_LIGHTRED, string); format(string, sizeof(string), "Voce foi avisado por %s, Motivo: %s", sendername, (result)); SendClientMessage(giveplayerid, COLOR_LIGHTRED, string); return 1; } }//not connected } else { format(string, sizeof(string), " %d estб off-line.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }
Код:
enum pInfo { pKey[128], pAwarns, pLevel, pAdmin, PpLoja247, PpLoja2472, PLojaA1, PLojaA2, ArmaLoja, pSocio, pVIP, gPupgrade, pConnectTime, pReg, pSex, pFamily, pAge, pOrigem, pCK, pMuted, pExp, pCash, pConta, pCrimes, pKills, pDeaths, pArrested, pWantedDeaths, pPhoneBook, pLottoNr, pFishes, pBiggestFish, pEmprego, pPayCheck, pHeadValue, pJailed, pJailTime, pMats, pDrogas, pDrogas2, pDrogas3, pLider, pMembro, pFMember, pCargo, pChar, pContractTime, pDetSkill, pSexSkill, pBoxSkill, pLawSkill, pMechSkill, pJackSkill, pCarSkill, pNewsSkill, pDrogasSkill, pBalinhaSkill, pCookSkill, pFishSkill, Float:pHealth, Float:pSHealth, pInt, pLocal, pTeam, pModel, pPnumber, pPassagem, pPPassaporte, pPLider, pPCasakey, pPbiskey, Float:pPos_x, Float:pPos_y, Float:pPos_z, pCarLic, pFlyLic, pBoatLic, pFishLic, pGunLic, pGun1, pGun2, pGun3, pGun4, pAmmo1, pAmmo2, pAmmo3, pAmmo4, pCarTime, pPayDay, pPayDayHad, pCDPlayer, pWins, pLoses, pAlcoholPerk, pDrugPerk, pMiserPerk, pPainPerk, pTraderPerk, pTut, pMissionNr, pWarns, pAdjustable, pFuel, pMarried, pBalinha, pRoadblock, pRoadPregos, pRequestingBackup, pAPaisana, pAPaisanaCIA, pMask, pMaskuse, pBarraca, pMarriedTo[128], pSpawn, pBan, pSafeDrogas, pSafeDrogas2, pSafeDrogas3, pVeiculo, pCarKey, psMats, VipVaga, adminID, vipID, pPCasaCarkey, pCheckInfoOrg, pTornaLider, };
vlw