SetLevel / SetPlayerMapIcon / SetPlayerFightingStyle (Resol.= DraKoN/Protioso)
#1

SetLevel:

pawn Код:
if(strcmp(cmd, "/setlevel", true) == 0) {
if(IsPlayerAdmin(playerid)){
new tmp[256];
     new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, COLOR_RED, "/setlevel [id] [Level]");
  return 1;
}
  plid = strval(tmp);
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
        SendClientMessage(playerid, COLOR_RED, "/setlevel [id] [Level]");
  return 1;
}
if(IsPlayerConnected(plid)){
        pap_SalvarInt(playerid, "Level", Level[playerid]);
SendClientMessage(playerid, COLOR_GREEN, "[INFO] Level Setado.");
        new string[64];
        format(string, sizeof(string), "Seu Level foi setado para: %d ", Level[playerid]);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        SetPlayerScore(playerid, Level[playerid]);
         return 1;
}
else{
  SendClientMessage(playerid, COLOR_RED, "[ERRO]Jogador nгo conectado/logado.");
  return 1;
}
}
else{
  SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo tem permissгo!");
  return 1;
}
}
Tentei criar um comando de setar level par a o meu servidor, porйm, eu uso o comando aparece um aviso que setou, sу que nгo acontece anda com level. O que tenho que fazer para arrumar?

RESOLVIDO: POST DO PROTIOSO (EXPLICAЗГO)

-------------------------------------------------------------------------------------------------------------------------------

SetPlayerMapIcon:

pawn Код:
SetPlayerMapIcon(playerid, 23, 1219.2263, -1814.1140, 16.5938, 23, 0 );
  SetPlayerMapIcon(playerid, 23, 2461.1196, 1559.4412, 11.6803, 23, 0 );
  SetPlayerMapIcon(playerid, 23, -2650.0020, 376.0294, 6.1563, 23, 0 );
  SetPlayerMapIcon(playerid, 23, 1324.5930, 287.0905, 20.0452, 23, 0 );
Estou tentando adicionar esse MapIcon no meu GM, utilizei o tutorial da Wiki, sу que nгo entendi muito bom, entгo quando coloco 1 MapIcon ele aparece, se eu colocar masi de 1 nгo aparece nenhum.

RESOLVIDO: COLOCAR "IDs" NOS MAPICONS

-------------------------------------------------------------------------------------------------------------------------------

SetPlayerFightingStyle:

Mesmo usando o comando de exemplo da Wiki, quando eu vou copilar, aparece isso:

pawn Код:
undefined symbol "SetPlayerFightingStyle"
undefined symbol "GetPlayerFightingStyle"
RESOLVIDO: ATUALIZAR INCLUDES

-------------------------------------------------------------------------------------------------------------------------------
Reply
#2

Baixa Ultima Includes do SA:MP
Reply
#3

Quote:
Originally Posted by DraKoNeoN
Baixa Ultima Includes do SA:MP
a_samp?

=============> EDIT

Eu tava com o SA:MP 0.3a R7, e sу tinha atualizado o .exe do pawn, e nгo as includes Agora foi =)


E as outras?
Reply
#4

no /setlevel faltou colocar Level[playerid] = level; e umas paradas pra pegar o level digitado no cmd...
pawn Код:
if(strcmp(cmd, "/setlevel", true) == 0)
{
    if(IsPlayerAdmin(playerid))
    {
        new tmp[256];
        new plid, level;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_RED, "/setlevel [id] [Level]");
          return 1;
        }
      plid = strval(tmp);
    tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_RED, "/setlevel [id] [Level]");
          return 1;
        }
        level = strval(tmp);
        if(IsPlayerConnected(plid))
        {
          Level[playerid] = level;
            pap_SalvarInt(playerid, "Level", Level[playerid]);
            SendClientMessage(playerid, COLOR_GREEN, "[INFO] Level Setado.");
            new string[64];
            format(string, sizeof(string), "Seu Level foi setado para: %d ", Level[playerid]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            SetPlayerScore(playerid, Level[playerid]);
            return 1;
        }
        else
        {
          SendClientMessage(playerid, COLOR_RED, "[ERRO]Jogador nгo conectado/logado.");
          return 1;
        }
    }
    else
    {
      SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo tem permissгo!");
      return 1;
    }
}
Faltou colocar o id do нcone... Cada нcone colocado tem que aumentar o nъmero que estб em negrito:
Quote:

SetPlayerMapIcon(playerid, 1, 1219.2263, -1814.1140, 16.5938, 23, 0);
SetPlayerMapIcon(playerid, 2, 2461.1196, 1559.4412, 11.6803, 23, 0);
SetPlayerMapIcon(playerid, 3, -2650.0020, 376.0294, 6.1563, 23, 0);
SetPlayerMapIcon(playerid, 4, 1324.5930, 287.0905, 20.0452, 23, 0);

Se quiser usar mapicons sem limite, pode usar o P-Streamer - http://forum.sa-mp.com/index.php?topic=174718.0
Pra usar as funзхes para criar mapicon dele, basta fazer isso:
1- coloque no inнcio do script #include "PMS"
2- vб no ongamemodeinit e coloque as funзхes de criar mapicon da seguinte maneira pms_CriarMapIcon(Float, Float:y, Float:z, modeloid, cor, Float:raio_visualizacao = PMS_RAIO_STREAM_PADRAO, virtualword = -1);
Nгo precisa do 'id do нcone' usado na funзгo original do samp. Basta X, Y, Z, id do MODELO (no seu caso 23) e cor. Se quiser colocar um raio e virtualworld, fique a vontade, caso contrбrio a funзгo pode ser resumida assim pms_CriarMapIcon(Float, Float:y, Float:z, modeloid, cor);


Sobre o SetPlayerFightingStyle e GetPlayerFightingStyle, baixa o samp server mais novo (0.3aR7 atualmente) e pхe os includes na pasta do seu pawno.

Boa sorte, flws!
Reply
#5

Obrigado Protioso e DraKoN, deu tudo certo. Protioso se eu for usar mais MapIcon eu uso sua include.

Obrigado pela ajuda.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)