[AJUDA] Aviso para Administradores -
titinho557 - 07.10.2011
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
Код:
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;
}
Meu pInfo
Код:
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,
};
Se vocкs poderem me ajudar eu ficarei muito agradecido
vlw
Re: [AJUDA] Aviso para Administradores -
ViniBorn - 07.10.2011
Qual o problema ?
Re: [AJUDA] Aviso para Administradores -
titinho557 - 07.10.2011
O Pawno da crash.
Re: [AJUDA] Aviso para Administradores -
ViniBorn - 07.10.2011
Troque isso
pawn Код:
if (PlayerInfo[playerid][pAdmin] >= 1337)
      }
Por isso
pawn Код:
if (PlayerInfo[playerid][pAdmin] >= 1337)
      {
Re: [AJUDA] Aviso para Administradores -
titinho557 - 07.10.2011
Код:
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(15410) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(15410) : error 033: array must be indexed (variable "cmd")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(15429) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(15429) : error 033: array must be indexed (variable "tmp")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(15470) : error 017: undefined symbol "pMotivo"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(15471) : error 017: undefined symbol "pAdminName"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(15502) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(15502) : error 033: array must be indexed (variable "tmp")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16275) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16275) : error 033: array must be indexed (variable "tmp")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16313) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16313) : error 033: array must be indexed (variable "tmp")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16349) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16349) : error 033: array must be indexed (variable "tmp")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16389) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16389) : error 033: array must be indexed (variable "tmp")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16413) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16413) : error 033: array must be indexed (variable "tmp")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16435) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16435) : error 033: array must be indexed (variable "tmp")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16487) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16487) : error 033: array must be indexed (variable "tmp")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16515) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16515) : error 033: array must be indexed (variable "tmp")
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16565) : error 017: undefined symbol "strtok"
E:\DOCUME~1\CASAPC~1\MEUSDO~1\PROGRA~1\GAMEMO~1\BFL\GAMEMO~1\BFL.pwn(16565) : error 033: array must be indexed (variable "tmp")
26 erros deve ser chave eu vo ver aki
Re: [AJUDA] Aviso para Administradores -
titinho557 - 07.10.2011
mals pelo double,
consegui era sу o erro da chave os 26 foram que eu coloquei no gm errado.
vlw gente.