SA-MP Forums Archive
[Ajuda] Me ajudem com meu comando /sirene - 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] Me ajudem com meu comando /sirene (/showthread.php?tid=385622)



Me ajudem com meu comando /sirene - Vinicius_TroLL - 16.10.2012

Alguem me ajuda? eu nao consigo por o comando para os cops colocarem sirene em qualquer veiculo...
comando
Код:
    if(strcmp(cmd, "/sirene", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
            if(PlayerInfo[playerid][pSocio] >= 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    if(GetPVarInt(playerid, "SireneStatus") == 0)
                    {
                        SetPVarInt(playerid, "SireneStatus", 1);
                        SetPVarInt(playerid, "undercover", CreateObject(18646,0,0,0,0,0,0));
        	            SetPVarInt(playerid, "undercover1", CreateObject(18646,0,0,0,0,0,0));
        	            AttachObjectToVehicle(GetPVarInt(playerid, "undercover"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
        	            AttachObjectToVehicle(GetPVarInt(playerid, "undercover1"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
						return 1;
					}
                    else if(GetPVarInt(playerid, "SireneStatus") == 1)
                    {
                        SetPVarInt(playerid, "SireneStatus", 0);
                        DestroyObject(GetPVarInt(playerid, "undercover"));
                        DestroyObject(GetPVarInt(playerid, "undercover1"));
                        return 1;
                    }

                }
            }

        }
        return 1;
	}



Re: Me ajudem com meu comando /sirene - Q.I - 16.10.2012

cade a variavel dos cops ?


Re: Me ajudem com meu comando /sirene - Vinicius_TroLL - 16.10.2012

Como assim? eu coloquei ai eu modifiquei e fico assim у
Код:
    if(strcmp(cmd, "/sirene", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
            if(!IsACop(playerid))
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    if(GetPVarInt(playerid, "SireneStatus") == 0)
                    {
                        SetPVarInt(playerid, "SireneStatus", 1);
                        SetPVarInt(playerid, "undercover", CreateObject(18646,0,0,0,0,0,0));
        	            SetPVarInt(playerid, "undercover1", CreateObject(18646,0,0,0,0,0,0));
        	            AttachObjectToVehicle(GetPVarInt(playerid, "undercover"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
        	            AttachObjectToVehicle(GetPVarInt(playerid, "undercover1"), GetPlayerVehicleID(playerid), -0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
						return 1;
					}
                    else if(GetPVarInt(playerid, "SireneStatus") == 1)
                    {
                        SetPVarInt(playerid, "SireneStatus", 0);
                        DestroyObject(GetPVarInt(playerid, "undercover"));
                        DestroyObject(GetPVarInt(playerid, "undercover1"));
                        return 1;
                    }

                }
            }

        }
        return 1;
	}

mais mesmo assim nao funciono


Re: Me ajudem com meu comando /sirene - leandro123456 - 16.10.2012

Tenta esse ai. Eu testei aqui e deu certo
pawn Код:
if(strcmp(cmd, "/sirene", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!IsACop(playerid))
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    if(GetPVarInt(playerid, "SireneStatus") == 0)
            {
                SetPVarInt(playerid, "SireneStatus", 1);
                SetPVarInt(playerid, "undercover", CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0));
                SetPVarInt(playerid, "undercover1", CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0));
                AttachObjectToVehicle(GetPVarInt(playerid, "undercover"), GetPlayerVehicleID(playerid), -0.43, 0.0, 0.785, 0.0, 0.1, 0.0);
                AttachObjectToVehicle(GetPVarInt(playerid, "undercover1"), GetPlayerVehicleID(playerid), -0.43, 0.0, 0.785, 0.0, 0.1, 0.0);
                return 1;
            }
            else if(GetPVarInt(playerid, "SireneStatus") == 1)
            {
                SetPVarInt(playerid, "SireneStatus", 0);
                DestroyObject(GetPVarInt(playerid, "undercover"));
                DestroyObject(GetPVarInt(playerid, "undercover1"));
                return 1;
            }

                }
            }

        }
        return 1;
    }



Re: Me ajudem com meu comando /sirene - ForT - 16.10.2012

PHP код:
    if(strcmp(cmd"/sirene"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
IsPlayerInAnyVehicle(playerid))
            {
                if(!
IsACop(playerid))return SendClientMessage(playerid, -1"Vocк nгo й COP!");
                if(
GetPVarInt(playerid"SireneStatus") == 0)
                {
                    
SetPVarInt(playerid"SireneStatus"1);
                    
SetPVarInt(playerid"undercover"CreateObject(18646,0,0,0,0,0,0));
                    
SetPVarInt(playerid"undercover1"CreateObject(18646,0,0,0,0,0,0));
                    
AttachObjectToVehicle(GetPVarInt(playerid"undercover"), GetPlayerVehicleID(playerid), -0.5, -0.20.82.02.03.0);
                    
AttachObjectToVehicle(GetPVarInt(playerid"undercover1"), GetPlayerVehicleID(playerid), -0.5, -0.20.82.02.03.0);
                    return 
1;
                }
                else if(
GetPVarInt(playerid"SireneStatus") == 1)
                {
                    
SetPVarInt(playerid"SireneStatus"0);
                    
DestroyObject(GetPVarInt(playerid"undercover"));
                    
DestroyObject(GetPVarInt(playerid"undercover1"));
                    return 
1;
                }
            }

        }
        return 
1;
    } 



Re: Me ajudem com meu comando /sirene - Vinicius_TroLL - 16.10.2012

Eu coloquei o comando e copilei mais quando eu entro no servidor e digito o comando nao da certo, e ag?


Re: Me ajudem com meu comando /sirene - Vinicius_TroLL - 17.10.2012

Quote:
Originally Posted by ForT
Посмотреть сообщение
PHP код:
    if(strcmp(cmd"/sirene"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
IsPlayerInAnyVehicle(playerid))
            {
                if(!
IsACop(playerid))return SendClientMessage(playerid, -1"Vocк nгo й COP!");
                if(
GetPVarInt(playerid"SireneStatus") == 0)
                {
                    
SetPVarInt(playerid"SireneStatus"1);
                    
SetPVarInt(playerid"undercover"CreateObject(18646,0,0,0,0,0,0));
                    
SetPVarInt(playerid"undercover1"CreateObject(18646,0,0,0,0,0,0));
                    
AttachObjectToVehicle(GetPVarInt(playerid"undercover"), GetPlayerVehicleID(playerid), -0.5, -0.20.82.02.03.0);
                    
AttachObjectToVehicle(GetPVarInt(playerid"undercover1"), GetPlayerVehicleID(playerid), -0.5, -0.20.82.02.03.0);
                    return 
1;
                }
                else if(
GetPVarInt(playerid"SireneStatus") == 1)
                {
                    
SetPVarInt(playerid"SireneStatus"0);
                    
DestroyObject(GetPVarInt(playerid"undercover"));
                    
DestroyObject(GetPVarInt(playerid"undercover1"));
                    return 
1;
                }
            }
        }
        return 
1;
    } 
Agora deu, obrigado...