08.02.2019, 21:27
Quote:
manda o codigo do comando "setadmin" e o de onde verifica o login.
|
PHP Code:
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;
}
}
}