manda o codigo do comando "setadmin" e o de onde verifica o login.
|
if(strcmp(cmd,"/setadmin", true)==0){
if(IsPlayerAdmin(playerid)){
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, COR_ERRO, "[] Digite: /setadmin [id] [Level]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COR_ERRO, "[] Digite: /setadmin [id] [Level]");
return 1;
}
skin = strval(tmp);
if(skin>=7){
SendClientMessage(playerid, COR_ERRO, "[] O level Permitido para ADM e 0 a 6!");
return 1;
}
SendClientMessage(playerid,AzulClaro,"-----------------------------------------------------------------------------------------------------------------------------------");
format(gstring, 400,"Parabйns pela promoзгo: %s",PlayerName(playerid));
SendClientMessage(playerid,AzulClaro,gstring);
SendClientMessage(playerid,AzulClaro,"Use: /comandosadm para conhecer seus novos comandos");
SendClientMessage(playerid,AzulClaro,"-----------------------------------------------------------------------------------------------------------------------------------");
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
if(IsPlayerConnected(plid)){
if(skin>=1){
pAdmin[plid] = skin;
SpawnPlayer(plid);
format(string, sizeof(string), "[] O %s %s Promoveu ( %s ) Para %s Do Servidor", CargoAdmin(playerid),PlayerName(playerid),PlayerName(playerid),CargoAdmin(playerid),pname);
SendClientMessageToAll(AzulClaro, string);
}
if(skin == 0){
pAdmin[plid] = 0;
SpawnPlayer(plid);
format(string, sizeof(string), "[] O %s %s Removeu %s da STAFF!", PlayerName(playerid),pname);
SendClientMessage(playerid, COR_ERRO, string);
}
return 1;
}else{
SendClientMessage(playerid, COR_ERRO, "[] Jogador offline");
return 1;
}
}
}
new cmd[50], idx;
cmd = strtok(cmdtext, idx);
if(!strcmp(cmd,"/setadmin2", true)){
if(IsPlayerAdmin(playerid))
{
new tmp[20], plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COR_ERRO, "[] Digite: /setadmin [id] [Level]");
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COR_ERRO, "[] Digite: /setadmin [id] [Level]");
skin = strval(tmp);
if(skin > 6 || skin < 0) return SendClientMessage(playerid, COR_ERRO, "[] O level Permitido para ADM e 0 a 6!");
SendClientMessage(playerid,AzulClaro,"-----------------------------------------------------------------------------------------------------------------------------------");
format(gstring, 50,"Parabйns pela promoзгo: %s",PlayerName(playerid));
SendClientMessage(playerid,AzulClaro,gstring);
SendClientMessage(playerid,AzulClaro,"Use: /comandosadm para conhecer seus novos comandos");
SendClientMessage(playerid,AzulClaro,"-----------------------------------------------------------------------------------------------------------------------------------");
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
if(IsPlayerConnected(plid))
{
if(skin > 0){
pAdmin[plid] = skin;
SpawnPlayer(plid);
format(string, sizeof(string), "[] O %s %s Promoveu ( %s ) Para %s Do Servidor", CargoAdmin(playerid),PlayerName(playerid),PlayerName(playerid),CargoAdmin(playerid),pname);
SendClientMessageToAll(AzulClaro, string);
}
else
{
pAdmin[plid] = 0;
SpawnPlayer(plid);
format(string, sizeof(string), "[] O %s %s Removeu %s da STAFF!", PlayerName(playerid),pname);
SendClientMessage(playerid, COR_ERRO, string);
}
printf("Level admin player: %d",pAdmin[plid]);
return 1;
}else return SendClientMessage(playerid, COR_ERRO, "[] Jogador offline");
}
}