[Pedido] Comando de convidar player
#4

Com base no cуdigo do amigo acima:
Код:
new bool:CANCELADO;
CMD:convidartodos(playerid, params[]) 
{ 
    new  
        Float:x, 
        Float:y, 
        Float:z; 

    GetPlayerPos(playerid, x, y, z); 

    for (new i = 0; i < MAX_PLAYERS; i ++) if (!GetPVarFloat(i, "AdmX")) { 
        SendClientMessage(i, -1, "Um Administrador estб convidado todos do servidor para ir atй ele."); 

        SetPVarFloat(i, "AdmX", x); 
        SetPVarFloat(i, "AdmY", y); 
        SetPVarFloat(i, "AdmZ", z); 
        CANCELADO = false;
    } 
    return 1; 
} 

CMD:aceitar(playerid, params[]) 
{ 
    if(CANCELADO == true) return SendClientMessage(playerid, -1, "Convites cancelados pelo Admin");
    if (!GetPVarFloat(playerid, "AdmX")) 
        return 1; 

    SetPlayerPos(playerid, GetPVarFloat(playerid, "AdmX"), GetPVarFloat(playerid, "AdmY"), GetPVarFloat(playerid, "AdmZ")); 

    DeletePVar(playerid, "AdmX");  
    DeletePVar(playerid, "AdmY"); 
    DeletePVar(playerid, "AdmZ");     
    return 1;     
} 

CMD:negar(playerid, params[]) 
{ 
    if (!GetPVarFloat(playerid, "AdmX")) 
        return 1; 

    DeletePVar(playerid, "AdmX");  
    DeletePVar(playerid, "AdmY"); 
    DeletePVar(playerid, "AdmZ"); 
    return 1;     
} 

CMD:cancelarconvite(playerid, params[]) 
{ 
    for (new i = 0; i < MAX_PLAYERS; i ++) if (GetPVarFloat(i, "AdmX")) { 
        DeletePVar(i, "AdmX");  
        DeletePVar(i, "AdmY"); 
        DeletePVar(i, "AdmZ"); 
        CANCELADO = true;
    } 
    return 1;     
}
vc pode fazer uma variavel para guardar valores booleanos que sгo True e False.
Algoritimo: se a bool cancelado, estiver true. Ngm poderб mais dar o comando
Reply


Messages In This Thread
Comando de convidar player - by Fix3r - 10.02.2017, 21:58
Re: Comando de convidar player - by 1sbedx - 10.02.2017, 22:31
Re: Comando de convidar player - by Fix3r - 10.02.2017, 23:53
Re: Comando de convidar player - by TheBob - 11.02.2017, 01:19
Re: Comando de convidar player - by Fix3r - 11.02.2017, 01:56

Forum Jump:


Users browsing this thread: 2 Guest(s)