[Ajuda] Nгo "identificando" no comando
#1

Bom, eu tava criando aqui guardiгo. Bom, criei os comandos todos loguei, teste deu certo. Mas logo em seguida, quando eu coloquei pra quando setar admin (/setadmin) tambйm jб setar o VIP, loguei e fui testa novamente o guardiгo, aparecia a mensagem de que eu nгo tinha permissгo. Sendo que eu estava com guardiгo setado. Tentei de diversas maneiras nгo consegui. Entгo desisti e coloquei if(dini_Int(file, "GUARDIAO") == 1)){ ao invйs de if(guardiao == 1){ , que era o que estava. Bom, vou deixar aqui o comando de setar guardiao e um comando onde й usado if(guardiao == 1){ . Se puderem me ajudar, obrigado desde jб.

pawn Код:
//===============================================
//[COMANDOS]

if(strcmp(cmd, "/setguard", true) == 0) {
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, 0x008040AA, "(ERRO) Use: /setguard [id].");
return 1;
}
plid = strval(tmp);
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(IsPlayerConnected(plid)){
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
dini_IntSet(file2, "GUARDIAO",1);
SpawnPlayer(plid);
SendClientMessage(playerid, 0x00FF00AA, "(INFO) Guardiгo Setado!");
format(string, sizeof(string), "{00FF00}(INFO) O Admin Rcon %s (%d) (») Te promoveu а Guardiгo", aname,playerid);
SendClientMessage(plid, tcadm, string);
return 1;
}else{
SendClientMessage(playerid, Vermelho, "(ERRO) ID invбlido");
return 1;
}
}

//===============================================================
//COMANDO QUE PAROU DE FUNCIONAR

if (strcmp(cmdtext,"/ai", true)==0){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] > 0 || guardiao[playerid] == 1){
MoveObject(portaoilha,836.70001, -2198.5, 3.6, 4.0);
SendClientMessage(playerid,0x607840AA, "Portгo da ilha Aberto!");
return 1;
} else {
SendClientMessage(playerid,Vermelho,"Vocк nгo tem permissгo!");
}
return 1;
}

//================================================
//[COMO FOI DEIXADO]
new guardiao;
guardiao[playerid] = 0;

mnguardiao;
mnguardiao = dini_Int(file, "GUARDIAO");
dini_IntSet(file2, "GUARDIAO", mnguardiao);
Reply
#2

Consegui resolver. Tinha me esqueci de definir

pawn Код:
if(dini_Int(file, "GUARDIAO") == 1;
guardiao[playerid] == 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)