[Ajuda] ZMCD para strcmp ~
#1

queria tranformar esse cmd para strcmp, o sistema foi encontrado aq na forum samp msm postado por [NRG]Dark
pawn Код:
CMD:chapeu(playerid, params[]) {
    if(Chapeu[playerid]==0){
        SetPlayerAttachedObject(playerid,1,19066,2,0.13,0.0,0.0,90,90.0,0.0);
        Chapeu[playerid] = 1;
        SendClientMessage(playerid,-1,"On");
        }else{
        RemovePlayerAttachedObject(playerid,1);
        SendClientMessage(playerid,-1,"Off");
    }
    return 1;
}
Tentativas ~
pawn Код:
if(strcmp(cmdtext,"/Chapeu", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(Chapeu[playerid]==0)
            {
                SetPlayerAttachedObject(playerid,1,19066,2,0.13,0.0,0.0,90,90.0,0.0);
                Chapeu[playerid] = 1;
                SendClientMessage(playerid,-1,"On");
            }
            else
            {
                RemovePlayerAttachedObject(playerid,1);
                SendClientMessage(playerid,-1,"Off");
        }
        return 1;
    }
Tentativa Fail ._.
Reply
#2

Por que vocк desotimizou o comando?

pawn Код:
if(strcmp(cmdtext,"/Chapeu", true) ==0)
{
    if(Chapeu[playerid]==0){
        SetPlayerAttachedObject(playerid,1,19066,2,0.13,0.0,0.0,90,90.0,0.0);
        Chapeu[playerid] = 1;
        SendClientMessage(playerid,-1,"On");
        }else{
        RemovePlayerAttachedObject(playerid,1);
        SendClientMessage(playerid,-1,"Off");
    }
    return 1;
}
Reply
#3

zmcd? num vi esse processador de comando ainda, link ?
Reply
#4

Quote:
Originally Posted by death1
Посмотреть сообщение
zmcd? num vi esse processador de comando ainda, link ?
Nossa em intelectual, que acha que й foda por zoar erro de digitaзгo.
vai lб mlk, ir almoзa se nгo sua mгe arranca seu pc :C

----------------------------------------------------------------------------------------------------------------
obrigado delete, compilou, vou testar agr (;
Rep s2.
Reply
#5

Quote:
Originally Posted by delete
Посмотреть сообщение
Por que vocк desotimizou o comando?

pawn Код:
if(strcmp(cmdtext,"/Chapeu", true) ==0)
{
    if(Chapeu[playerid]==0){
        SetPlayerAttachedObject(playerid,1,19066,2,0.13,0.0,0.0,90,90.0,0.0);
        Chapeu[playerid] = 1;
        SendClientMessage(playerid,-1,"On");
        }else{
        RemovePlayerAttachedObject(playerid,1);
        SendClientMessage(playerid,-1,"Off");
    }
    return 1;
}
Entrei no sv, testei, eu do /chapeu ele aparece logo some.
e quando dou /chapeu dnovo mostra a msg off.
e se eu digitar pela 3Є vez off novamente.
o que deve tar causando isto?

@Edit

Dividi em 2 comandos e o chapeu continua aparecendo rapidamente e desaparecendo.

pawn Код:
if(strcmp(cmdtext,"/chapeu", true) ==0)
    {
        SetPlayerAttachedObject(playerid,1,19066,2,0.13,0.0,0.0,90,90.0,0.0);
        SendClientMessage(playerid,-1,"Vocк colocou seu chapйu natalino [BWE] para retira-lo /rchapeu");
        return 1;
    }
    if(strcmp(cmdtext,"/rchapeu", true) ==0)
    {
        RemovePlayerAttachedObject(playerid,1);
        SendClientMessage(playerid,-1,"Vocк retirou seu chapйu natalino [BWE] para coloca-lo /chapeu.");
        return 1;
    }
@EDIT2

Ja concertei, troquei o SetPlayerAttachedObject.

pawn Код:
SetPlayerAttachedObject(playerid, 3, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
Obrigado msm assim .
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)