SA-MP Forums Archive
[AJUDA] Comando no Checkpoint - 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] Comando no Checkpoint (/showthread.php?tid=224044)



[AJUDA] Comando no Checkpoint - Wendell_. - 10.02.2011

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;
}



Re: [AJUDA] Comando no Checkpoint - ManoLexuS - 10.02.2011

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.


Re: [AJUDA] Comando no Checkpoint - Wendell_. - 11.02.2011

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 (:


Re: [AJUDA] Comando no Checkpoint - Macintosh - 11.02.2011

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;
  }