Admin Dando Erro -
JuniorTheDM - 28.06.2015
PHP код:
/*Linha: 73*/public OnPlayerDisconnect()
/*Linha: 74*/{
/*Linha: 75*/new arquiva[34], playernome[MAX_PLAYER_NAME];
/*Linha: 76*/ GetPlayerName(playerid, playernome, sizeof(playernome));
/*Linha: 77*/ format(arquiva, sizeof(arquiva), "Admins/%s", playernome);
/*Linha: 78*/ if(DOF2_FileExists(arquiva))
/*Linha: 79*/ {
/*Linha: 80*/ DOF2_SetInt(arquiva, "Level", pAdmin[playerid][Level]);
/*Linha: 81*/ DOF2_SaveFile();
/*Linha: 82*/ }
/*Linha: 83*/ else
/*Linha: 84*/ {
/*Linha: 85*/ DOF2_CreateFile(arquiva);
/*Linha: 86*/ DOF2_SetInt(arquiva, "Level", pAdmin[playerid][Level]);
/*Linha: 87*/ DOF2_SaveFile();
/*Linha: 88*/ return 1;
/*Linha: 89*/ }
/*Linha: 90*/ //============================={COMANDOS}====================================//
/*Linha: 91*/CMD:daradmin(playerid, params[])
/*Linha: 92*/{
/*Linha: 93*/ new id, level, string[256], string2[256], ganhou[MAX_PLAYER_NAME], deu[MAX_PLAYER_NAME];
/*Linha: 94*/ if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xAD0000AA, "{00E5FF}Vocк nгo estб autorizado.");
/*Linha: 95*/ if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, 0xAD0000AA, "Use /daradmin [ID] [LEVEL]");
/*Linha: 96*/ if (level < 0 || level > 5) return SendClientMessage(playerid, 0xFF0000FF, "Level invбlido. Use de 1 б 5 .");
/*Linha: 97*/ if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xAD0000AA, "Este jogador nгo estб online.");
/*Linha: 98*/ GetPlayerName(id, ganhou, sizeof(ganhou));
/*Linha: 99*/ GetPlayerName(playerid, deu, sizeof(deu));
/*Linha: 100*/ format(string, sizeof(string), "Vocк deu admin level %s para o %s", GetLevelAdmin(level), ganhou);
/*Linha: 101*/ SendClientMessage(playerid, 0x00F6F6AA, string);
/*Linha: 102*/ format(string2, sizeof(string2), "O admin %s deu admin level %s para vocк.", deu , GetLevelAdmin(level));
/*Linha: 103*/ SendClientMessage(id, VERDE, string2);
/*Linha: 104*/ pAdmin[id][Level] = level;
/*Linha: 105*/ return 1;
/*Linha: 106*/ }
PHP код:
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(76) : warning 217: loose indentation
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(76) : error 017: undefined symbol "playerid"
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(80) : error 017: undefined symbol "playerid"
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(86) : error 017: undefined symbol "playerid"
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(88) : error 079: inconsistent return types (array & non-array)
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(91) : warning 217: loose indentation
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(91) : error 029: invalid expression, assumed zero
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(91) : error 017: undefined symbol "cmd_daradmin"
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(91) : error 029: invalid expression, assumed zero
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(91) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
8 Errors.
Re: Admin Dando Erro -
iTakelot - 28.06.2015
Muda para este: se da certo me avise
+rep
PHP код:
/*Linha: 73*/public OnPlayerDisconnect(playerid, reason)
/*Linha: 74*/{
/*Linha: 75*/new arquiva[34], playernome[MAX_PLAYER_NAME];
/*Linha: 76*/ GetPlayerName(playerid, playernome, sizeof(playernome));
/*Linha: 77*/ format(arquiva, sizeof(arquiva), "Admins/%s", playernome);
/*Linha: 78*/ if(DOF2_FileExists(arquiva))
/*Linha: 79*/ {
/*Linha: 80*/ DOF2_SetInt(arquiva, "Level", pAdmin[playerid][Level]);
/*Linha: 81*/ DOF2_SaveFile();
/*Linha: 82*/ }
/*Linha: 83*/ else
/*Linha: 84*/ {
/*Linha: 85*/ DOF2_CreateFile(arquiva);
/*Linha: 86*/ DOF2_SetInt(arquiva, "Level", pAdmin[playerid][Level]);
/*Linha: 87*/ DOF2_SaveFile();
/*Linha: 88*/ return 1;
/*Linha: 89*/ }
/*Linha: 90*/ //============================={COMANDOS}====================================//
/*Linha: 91*/CMD:setaradmin(playerid, params[])
/*Linha: 92*/{
/*Linha: 93*/ new id, level, string[256], string2[256], ganhou[MAX_PLAYER_NAME], deu[MAX_PLAYER_NAME];
/*Linha: 94*/ if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xAD0000AA, "{00E5FF}Vocк nгo estб autorizado.");
/*Linha: 95*/ if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, 0xAD0000AA, "Use /daradmin [ID] [LEVEL]");
/*Linha: 96*/ if (level < 0 || level > 5) return SendClientMessage(playerid, 0xFF0000FF, "Level invбlido. Use de 1 б 5 .");
/*Linha: 97*/ if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xAD0000AA, "Este jogador nгo estб online.");
/*Linha: 98*/ GetPlayerName(id, ganhou, sizeof(ganhou));
/*Linha: 99*/ GetPlayerName(playerid, deu, sizeof(deu));
/*Linha: 100*/ format(string, sizeof(string), "Vocк deu admin level %s para o %s", GetLevelAdmin(level), ganhou);
/*Linha: 101*/ SendClientMessage(playerid, 0x00F6F6AA, string);
/*Linha: 102*/ format(string2, sizeof(string2), "O admin %s deu admin level %s para vocк.", deu , GetLevelAdmin(level));
/*Linha: 103*/ SendClientMessage(id, VERDE, string2);
/*Linha: 104*/ pAdmin[id][Level] = level;
/*Linha: 105*/ return 1;
/*Linha: 106*/ }
Re: Admin Dando Erro -
Gii - 28.06.2015
PHP код:
public OnPlayerDisconnect(playerid, reason) {
new arquiva[34], playernome[MAX_PLAYER_NAME];
GetPlayerName(playerid, playernome, sizeof(playernome));
format(arquiva, sizeof(arquiva), "Admins/%s", playernome);
if(DOF2_FileExists(arquiva))
{
DOF2_SetInt(arquiva, "Level", pAdmin[playerid][Level]);
DOF2_SaveFile();
}
else
{
DOF2_CreateFile(arquiva);
DOF2_SetInt(arquiva, "Level", pAdmin[playerid][Level]);
DOF2_SaveFile();
}
return 1;
}
//============================={COMANDOS}====================================//
CMD:setaradmin(playerid, params[])
{
new id, level, string[256], string2[256], ganhou[MAX_PLAYER_NAME], deu[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xAD0000AA, "{00E5FF}Vocк nгo estб autorizado.");
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, 0xAD0000AA, "Use /daradmin [ID] [LEVEL]");
if (level < 0 || level > 5) return SendClientMessage(playerid, 0xFF0000FF, "Level invбlido. Use de 1 б 5 .");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xAD0000AA, "Este jogador nгo estб online.");
GetPlayerName(id, ganhou, sizeof(ganhou));
GetPlayerName(playerid, deu, sizeof(deu));
format(string, sizeof(string), "Vocк deu admin level %s para o %s", GetLevelAdmin(level), ganhou);
SendClientMessage(playerid, 0x00F6F6AA, string);
format(string2, sizeof(string2), "O admin %s deu admin level %s para vocк.", deu , GetLevelAdmin(level));
SendClientMessage(id, VERDE, string2);
pAdmin[id][Level] = level;
return 1;
}
Lembrando que comandos em ZCMD devem ficar fora de qualquer callback.
Re: Admin Dando Erro -
Monotox - 28.06.2015
@Editado, postaram antes.
Re: Admin Dando Erro -
JuniorTheDM - 28.06.2015
obrigaod GIii vou dar +rep aos dois
Re: Admin Dando Erro -
JuniorTheDM - 28.06.2015
desculpe pelo double mais pode me ajudar nisso
PHP код:
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(126) : error 017: undefined symbol "PlayerInfo"
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(126) : warning 215: expression has no effect
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(126) : error 001: expected token: ";", but found "]"
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(126) : error 029: invalid expression, assumed zero
C:\Users\Usuario\Desktop\Nova pasta\gamemodes\BPS.pwn(126) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
PHP код:
CMD:pegaradm(playerid, params[])
{
PlayerInfo[playerid][pAdmin]= 5;
SendClientMessage(playerid, AMARELO_COR, "SERVER: Vocк agora й um admin FUNDADOR.");
return true;
}
Re: Admin Dando Erro -
Gii - 28.06.2015
PHP код:
CMD:pegaradm(playerid) {
pAdmin[playerid][Level] = 5;
SendClientMessage(playerid, AMARELO_COR, "SERVER: Vocк agora й um admin FUNDADOR.");
return true;
}
Re: Admin Dando Erro -
JuniorTheDM - 28.06.2015
muito obrigado Gii , Desejo uma Boa sorte no The NewRPG