[AJUDA] Comando no Checkpoint
#1

Estou com um problema em um comando que й para ser execultado somente no checkpoint. Mas ele tб execultando fora do checkpoint.
Comando:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/loja", cmdtext, true, 10) == 0)
{
    new aname[MAX_PLAYER_NAME];
    new string[256];
    GetPlayerName(playerid, aname, sizeof(aname));
    format(string, sizeof(string), "[SERVER]» O player %s estб comprando armas na loja do ammu. (/ammu)", aname,playerid);
    SendClientMessageToAll(0x80FF80AA,string);
    ShowPlayerDialog(playerid,LOJA,DIALOG_STYLE_LIST,"Loja de Armas","9mm $2.000\nDesert Eagle $4.000\nShotgun $6.000\nSawn $6.500\nCombat Shotgun $7.000\nMicro SMG $8.400\nMP5 $9.000\nAK-47 $13.000\nM4 $15.000\nTec9 $8.500\nSniper Rifle $16.000","Comprar","Cancelar");
    if(IsPlayerInCheckpoint(playerid)== cpcheck)
    SendClientMessage(playerid,0x5BB700AA, "[INFO]para comprar armas use /loja");
    }
    else
    SendClientMessage(playerid,0xFF0000AA ,"[INFO]Vocк nгo estб no checkpoint da Ammu Nation de Los Santos");
    return 1;
}
Reply
#2

Tenta com isso aqui:
pawn Код:
if(strcmp("/loja", cmdtext, true, 10) == 0)
    {
    new aname[MAX_PLAYER_NAME];
    new string[256];
    GetPlayerName(playerid, aname, sizeof(aname));
    format(string, sizeof(string), "[SERVER] O player %s estб comprando armas na loja do ammu. (/ammu)", aname,playerid);
    if(IsPlayerInCheckpoint(playerid)== cpcheck)
    {
    SendClientMessageToAll(0x80FF80AA,string);
    ShowPlayerDialog(playerid,LOJA,DIALOG_STYLE_LIST,"Loja de Armas","9mm $2.000\nDesert Eagle $4.000\nShotgun $6.000\nSawn $6.500\nCombat Shotgun $7.000\nMicro SMG $8.400\nMP5 $9.000\nAK-47 $13.000\nM4 $15.000\nTec9 $8.500\nSniper Rifle $16.000","Comprar","Cancelar");
    }
    else
    {
    SendClientMessage(playerid,0xFF0000AA ,"[INFO]Vocк nгo estб no checkpoint da Ammu Nation de Los Santos");
    }
    return 1;
}
Nгo testei, mas ahco que tб certo.
Espero ter ajudado.
Reply
#3

Quote:
Originally Posted by ManoLexuS
Посмотреть сообщение
Tenta com isso aqui:
pawn Код:
if(strcmp("/loja", cmdtext, true, 10) == 0)
    {
    new aname[MAX_PLAYER_NAME];
    new string[256];
    GetPlayerName(playerid, aname, sizeof(aname));
    format(string, sizeof(string), "[SERVER] O player %s estб comprando armas na loja do ammu. (/ammu)", aname,playerid);
    if(IsPlayerInCheckpoint(playerid)== cpcheck)
    {
    SendClientMessageToAll(0x80FF80AA,string);
    ShowPlayerDialog(playerid,LOJA,DIALOG_STYLE_LIST,"Loja de Armas","9mm $2.000\nDesert Eagle $4.000\nShotgun $6.000\nSawn $6.500\nCombat Shotgun $7.000\nMicro SMG $8.400\nMP5 $9.000\nAK-47 $13.000\nM4 $15.000\nTec9 $8.500\nSniper Rifle $16.000","Comprar","Cancelar");
    }
    else
    {
    SendClientMessage(playerid,0xFF0000AA ,"[INFO]Vocк nгo estб no checkpoint da Ammu Nation de Los Santos");
    }
    return 1;
}
Nгo testei, mas ahco que tб certo.
Espero ter ajudado.
Deu certo aqui. Valeu pela ajuda (:
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/loja", cmdtext, true, 10) == 0)
{
    new aname[MAX_PLAYER_NAME];
    new string[256];
   if(!IsPlayerInCheckpoint(playerid)== cpcheck)
   {
    SendClientMessage(playerid,0x5BB700AA, "Nгo estбs no checkpoint animal!");
    return 1;
    }
    GetPlayerName(playerid, aname, sizeof(aname));
    format(string, sizeof(string), "[SERVER]» O player %s estб comprando armas na loja do ammu. (/ammu)", aname,playerid);
    SendClientMessageToAll(0x80FF80AA,string);
    ShowPlayerDialog(playerid,LOJA,DIALOG_STYLE_LIST,"Loja de Armas","9mm $2.000\nDesert Eagle $4.000\nShotgun $6.000\nSawn $6.500\nCombat Shotgun $7.000\nMicro SMG $8.400\nMP5 $9.000\nAK-47 $13.000\nM4 $15.000\nTec9 $8.500\nSniper Rifle $16.000","Comprar","Cancelar");
    SendClientMessage(playerid,0x5BB700AA, "[INFO]para comprar armas use /loja");
    return 1;
   }
   return 1;
  }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)