[Ajuda] Me ajudem com meu comando /sirene
#1

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;
	}
Reply
#2

cade a variavel dos cops ?
Reply
#3

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
Reply
#4

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;
    }
Reply
#5

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;
    } 
Reply
#6

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

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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)