Comando /daradmin -
LeonardoBCF - 27.03.2013
No meu gm tem o comando mais quando vo usa-lo ingame nao aparece nada '-'
PHP код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
if (IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /daradmin [playerid/Parte-do-Nick] [level(1-5000)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 5000 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("|ADMIN|: %s promoveu %s para administrador no nivel %d.", sendername, giveplayer, level);
format(string, sizeof(string), "Vocк foi promovido a moderador, no nнvel %d pelo administrador %s.", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Vocк promoveu %s com nнvel %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo pode usar esse comando!");
}
}
return 1;
}
}
Re: Comando /daradmin -
FlaaSShh - 27.03.2013
Tente isso
pawn Код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
AdmsVaga();
if(VagaSobrando == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparadm primeiro.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /daradmin [id] [Nivel]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /daradmin [id] [Nivel]");
return 1;
}
level = strval(tmp);
if(level == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /limparadmin para limpar uma vaga");
return 1;
}
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(PlayerInfo[para1][pAdmin] >= 5000)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode promover um Admin Dono/Scripter!");
format(string, sizeof(string), "O admin %s tentou te promover a nivel %d",sendername ,level);
SendClientMessage(para1, COLOR_AZULBB, string);
return 1;
}
format(string, sizeof(string), " Vocк foi promovido para level %d de Admin - Por %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Vocк promoveu o(a) %s Para o level %d de Admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
getdate(year, month, day);
gettime(hour,minute,second);
format(string, sizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d].", sendername, level, giveplayer, day,
month, year, hour, minute, second);
PAdminsLog(string);
for(new i = 0; i < sizeof(AdmInfo); i++)
{
if(PlayerInfo[para1][pAdmin] > 0)
{
PlayerInfo[para1][pAdmin] = level;
break;
}
else if(AdmInfo[i][AdminVaga] == 0)
{
PlayerInfo[para1][pAdmin] = level;
AdmInfo[i][gMembro] = giveplayer;
AdmInfo[i][AdminVaga] = 1;
SaveAdm();
break;
}
}
}
}
}
return 1;
}
Re: Comando /daradmin -
LeonardoBCF - 27.03.2013
Ae man deu nao apareceu aqui 11 erros
PHP код:
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44547) : warning 217: loose indentation
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44556) : error 017: undefined symbol "AdmsVaga"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44557) : error 017: undefined symbol "VagaSobrando"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44593) : error 017: undefined symbol "COLOR_AZULBB"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44600) : error 017: undefined symbol "year"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44601) : error 017: undefined symbol "hour"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44602) : error 017: undefined symbol "day"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44604) : error 017: undefined symbol "PAdminsLog"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44605) : error 017: undefined symbol "AdmInfo"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44605) : error 036: empty statement
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44605) : error 017: undefined symbol "i"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44605) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
11 Errors.
Re: Comando /daradmin -
Flash92 - 27.03.2013
Tente este.
pawn Код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 5000)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um administrador!!");
return 1;
}
AdmsVaga();
if(VagaSobrando == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na administraзгo limpe primeiro /limparadm");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /daradmin [id] [Nivel]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /daradmin [id] [Nivel]");
return 1;
}
level = strval(tmp);
if(level == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /limparadmin para limpar uma vaga");
return 1;
}
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(PlayerInfo[para1][pAdmin] >= 5000)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode promover um Admin PROGRAMADOR!");
format(string, sizeof(string), "O admin %s tentou te promover a nivel %d",sendername ,level);
SendClientMessage(para1, 0x33FF00FF, string);
return 1;
}
format(string, sizeof(string), " Vocк foi promovido para level %d de Admin - Por %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Vocк promoveu o(a) %s Para o level %d de Admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
getdate(year, month, day);
gettime(hour,minute,second);
format(string, sizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d].", sendername, level, giveplayer, day,
month, year, hour, minute, second);
//PAdminsLog(string);
for(new i = 0; i < sizeof(AdmInfo); i++)
{
if(PlayerInfo[para1][pAdmin] > 0)
{
PlayerInfo[para1][pAdmin] = level;
break;
}
else if(AdmInfo[i][AdminVaga] == 0)
{
PlayerInfo[para1][pAdmin] = level;
AdmInfo[i][gMembro] = giveplayer;
AdmInfo[i][AdminVaga] = 1;
SaveAdm();
break;
}
}
}
}
}
return 1;
}
Se ajudei de uma Reputacao ai abaixo do prefil
Re: Comando /daradmin -
LeonardoBCF - 28.03.2013
deu 9 erros
Re: Comando /daradmin -
Flash92 - 29.03.2013
poste os erros
Re: Comando /daradmin -
LeonardoBCF - 29.03.2013
PHP код:
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(26347) : warning 217: loose indentation
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(26351) : warning 217: loose indentation
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44566) : warning 217: loose indentation
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44566) : error 017: undefined symbol "AdmsVaga"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44567) : error 017: undefined symbol "VagaSobrando"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44610) : error 017: undefined symbol "year"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44611) : error 017: undefined symbol "hour"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44612) : error 017: undefined symbol "day"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44615) : error 017: undefined symbol "AdmInfo"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44615) : error 036: empty statement
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44615) : error 017: undefined symbol "i"
C:\Users\HOT WHEELS\Music\Desktop\coisas para sa-mp\GM Codado\BrasilCity Net do Luiz Duarte\GM Brasil City Net\Brasil City net\gamemodes\BCF.pwn(44615) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
9 Errors.
Re: Comando /daradmin -
Flash92 - 13.04.2013
E as linhas
Re: Comando /daradmin -
bruxo00 - 13.04.2013
Enfim... tens um GameMode com muitas linhas, mas NEM sabe o que os erros significam? Esses erros, sгo de principiante, como eu...
Й sу traduzir os erros...:
error 017: undefined symbol "i"
Sнmbolo Indefenido : Quer dizer que a variбvel (i) nгo estб definida em nenhum sнtio, e tens de a definir. (Serve para todos deste gйnero)
error 036: empty statement
empty statement : Quer dizer que existem { } sem nada dentro. Procure na linha e do erro, e acharб.
fatal error 107: too many error messages on one line
too many error messages on one line : Muitos erros numa linha sу. Quando resolveres os erros acima, este desaparece.
warning 217: loose indentation
loose indentation : Indentaзгo Perdida. Exemplo:
Cуdigo sem indentaзгo:
PHP код:
CMD:kickme(playerid, params[])
{
SendClientMessage(playerid, COR, "Foste kickado");
Kick(playerid);
return 1;
}
Cуdigo com indentaзгo:
PHP код:
CMD:kickme(playerid, params[])
{
SendClientMessage(playerid, COR, "Foste kickado");
Kick(playerid);
return 1;
}
Re: Comando /daradmin -
Smoking_Script - 13.04.2013
tente assim agora acho que vai
Код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 5000 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /daradmin [playerid/Parte-do-Nick] [level(1-5000)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("|ADMIN|: %s promoveu %s para administrador no nivel %d.", sendername, giveplayer, level);
format(string, sizeof(string), "Vocк foi promovido a moderador, no nнvel %d pelo administrador %s.", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Vocк promoveu %s com nнvel %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo pode usar esse comando!");
}
}
return 1;
}
}
Espero ter ajudado se poder da reputaзao agradeзo '-'