SA-MP Forums Archive
[AJUDA] Distancia do objeto. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Distancia do objeto. (/showthread.php?tid=336219)



[AJUDA] Distancia do objeto. - 3V3RTON - 21.04.2012

Vou postar duas Duvidas minha aqui para nгo ficar criando outros Topic

1°Duvida:
Tou usando para o player Aperta Alt й o Elevador subir mais ele pode ta em qualquer lugar que se ele Aperta Alt
O Elevador sobir do mesmo jeito queria quem tive-se perto do Elevador pode-se usar o comando

if(strcmp("/subirdp", cmdtext, true) == 0) {
MoveObject(ELDP, 1570.6,-1635.3,27.2, 3.0);
SetTimer("TODOSP", 10000, false);
SendClientMessage(playerid,0xFFFFFFAA, "O Elevador descerб em 10 segundos.");
return 1;
}

if ((newkeys & KEY_WALK))
{
OnPlayerCommandText(playerid,"/subirdp");
}
-----------------------------------------
2°Duvida:
queria que o /darestudo o limite mбximo seria 5. tipo /darestudo 0 6
(ERRO) O mбximo й 5 por vez.

if(strcmp(cmd,"/darestudo", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "aAdmin") == 0 ){
SendClientMessage(playerid, Vermelho, "(INFO) Vocк nao e um admin!");
return 1;
}
if(pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "Digite: /darestudo [id] [level]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /darestudo [id] [level]");
return 1;
}
skin = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
format(string, sizeof(string), "(INFO) O Administrador %s (%d) te deu %d Level de estudo.", aname, playerid, skin);
SendClientMessage(plid, tcadm, string);
format(string, sizeof(string), "(INFO) Vocк deu a %s(ID: %d) %d Level de estudo.", pname, plid, skin);
SendClientMessage(playerid, Blue, string);
dini_IntSet(file2, "Faculdade", dini_Int(file2, "Faculdade")+skin);
return 1;
}else{
SendClientMessage(playerid, Vermelho, "(INFO) Jogador nгo conectado.");
return 1;
}
}
}


Re: [AJUDA] Distancia do objeto. - BreakDriFT - 21.04.2012

Use a funзгo IsPlayerRange


Re: [AJUDA] Distancia do objeto. - 3V3RTON - 21.04.2012

Quote:
Originally Posted by BreakDriFT
Посмотреть сообщение
Use a funзгo IsPlayerRange
Valeu memo , conseguir a 1°Duvida
Agora so falta a segunda [:


Re: [AJUDA] Distancia do objeto. - WagnerPM - 21.04.2012

arruma seu codigo [pawn*] [/pawn*]


Re: [AJUDA] Distancia do objeto. - RoacH` - 21.04.2012

pawn Код:
if(strcmp(cmd,"/darestudo", true)==0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(dini_Int(file, "aAdmin") == 0 ) return SendClientMessage(playerid, Vermelho, "(INFO) Vocк nao e um admin!");
    if(pAdmin[playerid] == 4 || pAdmin[playerid] == 5)
    {
        new tmp[256];
        new plid, skin;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "Digite: /darestudo [id] [level]");
        plid = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "Digite: /darestudo [id] [level]");
        skin = strval(tmp);
        if(skin < 0 || pAdmin[playerid] > 5) return SendClientMessage(playerid, Vermelho, "Limit max 5 e minimo 0");
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(plid, pname, MAX_PLAYER_NAME);
        format(file2, sizeof(file2), PASTA_CONTAS, pname);
        if(IsPlayerConnected(plid))
        {
            format(string, sizeof(string), "(INFO) O Administrador %s (%d) te deu %d Level de estudo.", aname, playerid, skin);
            SendClientMessage(plid, tcadm, string);
            format(string, sizeof(string), "(INFO) Vocк deu a %s(ID: %d) %d Level de estudo.", pname, plid, skin);
            SendClientMessage(playerid, Blue, string);
            dini_IntSet(file2, "Faculdade", dini_Int(file2, "Faculdade")+skin);
        }
        else {
            SendClientMessage(playerid, Vermelho, "(INFO) Jogador nгo conectado.");
        }
    }
    return 1;
}



Re: [AJUDA] Distancia do objeto. - 3V3RTON - 21.04.2012

Quote:
Originally Posted by RoacH`
Посмотреть сообщение
pawn Код:
if(strcmp(cmd,"/darestudo", true)==0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(dini_Int(file, "aAdmin") == 0 ) return SendClientMessage(playerid, Vermelho, "(INFO) Vocк nao e um admin!");
    if(pAdmin[playerid] == 4 || pAdmin[playerid] == 5)
    {
        new tmp[256];
        new plid, skin;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "Digite: /darestudo [id] [level]");
        plid = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "Digite: /darestudo [id] [level]");
        skin = strval(tmp);
        if(skin < 0 || pAdmin[playerid] > 5) return SendClientMessage(playerid, Vermelho, "Limit max 5 e minimo 0");
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(plid, pname, MAX_PLAYER_NAME);
        format(file2, sizeof(file2), PASTA_CONTAS, pname);
        if(IsPlayerConnected(plid))
        {
            format(string, sizeof(string), "(INFO) O Administrador %s (%d) te deu %d Level de estudo.", aname, playerid, skin);
            SendClientMessage(plid, tcadm, string);
            format(string, sizeof(string), "(INFO) Vocк deu a %s(ID: %d) %d Level de estudo.", pname, plid, skin);
            SendClientMessage(playerid, Blue, string);
            dini_IntSet(file2, "Faculdade", dini_Int(file2, "Faculdade")+skin);
        }
        else {
            SendClientMessage(playerid, Vermelho, "(INFO) Jogador nгo conectado.");
        }
    }
    return 1;
}
Nгo Fufo :/