SA-MP Forums Archive
[Ajuda] Rapido Aqui - 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] Rapido Aqui (/showthread.php?tid=377655)



Rapido Aqui - ~RdBzBarT - 15.09.2012

eu tenho esse codigo aqui

if(strcmp(cmdtext, "/minigun", true) == 0)
{
SetPlayerPos(playerid,283.6217,-136.7550,1004.0625);
new pname[MAX_PLAYER_NAME];
SetPlayerInterior(playerid,7);
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "{FF0000}%s {FFFFFF}foi na batalha de minigun {FF0000}( /minigun )", pname);
SendClientMessageToAll(COLOR_BRANCA, string);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 38, 99999);
return 1;
}
//

Agora tem como eu fazer para quando o player tiver dentro do teleporte ele nao usa nenhum comando apenas /sairdm? preciso muito dessa ajuda



Re: Rapido Aqui - Maklister - 15.09.2012

Tente

pawn Code:
new NaDM[MAX_PLAYERS];

public OnPlayerCommandText(playerid,cmdtext[])
{
    if(NaDM[playerid] == 1 && strcmp(cmdtext, "/sairdm", true) != 0)
    {
        SendClientMessage(playerid, -1,"[ERRO] Vocк estб na DM e sу pode digitar o comando /sairdm");
        return 0;
    }
    if(strcmp(cmdtext, "/minigun", true) == 0)
    {
        NaDM[playerid] = 1;
        SetPlayerPos(playerid,283.6217,-136.7550,1004.0625);
        new pname[MAX_PLAYER_NAME];
        SetPlayerInterior(playerid,7);
        GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
        format(string, sizeof(string), "{FF0000}%s {FFFFFF}foi na batalha de minigun {FF0000}( /minigun )", pname);
        SendClientMessageToAll(COLOR_BRANCA, string);
        PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 38, 99999);
        return 1;
    }
    if(strcmp(cmdtext, "/sairdm", true) == 0)
    {
       if(NaDM[playerid] == 0) return SendClientMessage(playerid, -1, "[ERRO] Vocк nгo estб na DM");
       SendClientMessage(playerid, -1, "[ SERV ] Voce saiu da DM.");
       SetPlayerPos(playerid, CordX, CordY, CordZ);
       NaDM[playerid] = 0;
       return 1;
    }
    return 0;
}