Jump to content
  • 0

pomoc Mrtvý pickup


Baseball

Dotaz

Zdravím,

udělal jsem si joby a začaly se mi prohazovat funkce, tak jsem šel na ATomasův TuT s pickupama ( http://pawno.cz/topic/26572-jak-zabranit-prohazovani-akci-v-pickupech/ )

udělal jsem to podle toho ale když do pickupu vejdu je nečinný. (pawno 0.3.7)

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(IsPlayerInSphere(playerid,1312.9969,2085.5222,10.8127,10))
         {
                SCM(playerid, bila,"Jsi zaměstnán jako Údržbář")
    		Zamestnani[playerid] = 1;
		return 1;
         }
    }
    if(IsPlayerInSphere(playerid,1306.5231,1614.9362,10.8203,10))
    {
	Zamestnani[playerid] = 2;
	SCM(playerid, bila,"Jsi zaměstnán jako Pilot")
        return 1;
    }
}		
Edited by Baseball
Link to comment
Share on other sites

19 odpovědí na tuto otázku

Recommended Posts

  • 0

public OnGameModeInit()
{
Create3DTextLabel("Údržbář",0x008000FF,1312.9969,2085.5222,10.8127+0.5, 50,0,0);
CreatePickup(1581,23,1312.9969,2085.5222,10.8127, 0);
Create3DTextLabel("Pilot", 0x4682B4FF,1306.5231,1614.9362,10.8203+0.5,50,0,0);
CreatePickup(1581,23,1306.5231,1614.9362,10.8203,0);
}
Link to comment
Share on other sites

  • 0

 

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(IsPlayerInSphere(playerid,1312.9969,2085.5222,10.8127,10))
         {
                SCM(playerid, bila,"Jsi zaměstnán jako Údržbář")
    		Zamestnani[playerid] = 1;
		return 1;
         }
    } // zatúlaná zátvorka?
    if(IsPlayerInSphere(playerid,1306.5231,1614.9362,10.8203,10))
    {
	Zamestnani[playerid] = 2;
	SCM(playerid, bila,"Jsi zaměstnán jako Pilot")
        return 1;
    }
}		
Link to comment
Share on other sites

  • 0

#define IsPlayerInSphere(%0,%1,%2,%3,%4) IsPlayerInRangeOfPoint(%0,%4,%1,%2,%3)

 

23? nezmizne když ho seberu. Když byl sám a nebylo to přes IsPlayerInSphere tak to šlapalo dobře

 

Edited by Baseball
Link to comment
Share on other sites

  • 0

Měl jsem tam 2 když to nefungovalo tak jsem tam dal větší..

 

Ani print to nevyvolá

 

 

dá se to použít i na CP? Ty mě to také prohazuje.

Edited by Baseball
Link to comment
Share on other sites

  • 0
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == PickupOp)
    {
        id_vozidla = GetPlayerVehicleID(playerid);
		SetVehicleHealth(id_vozidla,100);
		RepairVehicle(id_vozidla);
		return 1;
	}
 	if(pickupid == PickupNi)
    {
        id_vozidla = GetPlayerVehicleID(playerid);
		AddVehicleComponent(id_vozidla, 1010);
		return 1;
	}
	//Údržbář
 	if(IsPlayerInSphere(playerid,1312.9969,2085.5222,10.8127,2))
    {
    	
		Zamestnani[playerid] = 1;
	        SCM(playerid, bila, "Jsi zaměstnán jako Údržbář");
		return 1;
	}
	//Pilot
	//if(pickupid == Pilot)
	if(IsPlayerInSphere(playerid,1306.5231,1614.9362,10.8203,2))
        }
    	        print("TEST");
	        Zamestnani[playerid] = 2;
	         SCM(playerid, bila, "Jsi zaměstnán jako Pilot");
	}
	return 1;
}

PickupOp a Ni nejsou od začátku, vytvářejí se příkazem na pozici hráče.

 

OnGameModeInit

public OnGameModeInit()
{
Create3DTextLabel("Údržbář",0x008000FF,1312.9969,2085.5222,10.8127+0.5, 50,0,0);
/*Udrzbar*/ CreatePickup(1581,1,1312.9969,2085.5222,10.8127, 0);
Create3DTextLabel("Pilot", 0x4682B4FF,1306.5231,1614.9362,10.8203+0.5,50,0,0);
/*Pilot*/CreatePickup(1581,23,1306.5231,1614.9362,10.8203,0);
return 1;

CreateVehicle(...)
}

Tady se mi nechce sem dávat těch 400 aut +-

Link to comment
Share on other sites

  • 0

        //Pilot
//if(pickupid == Pilot)
if(IsPlayerInSphere(playerid,1306.5231,1614.9362,10.8203,2))
} // opačná zátvorka
print("TEST");
Zamestnani[playerid] = 2;
SCM(playerid, bila, "Jsi zaměstnán jako Pilot");
}
Link to comment
Share on other sites

  • 0

mne sa zdá že stále sem niečo skopíruješ potom to upravíš a nakoniec ti ani nemáme ako poradiť keď tu je niečo úplne iné.. takže buď hľadaj chybu vo svojom kóde, alebo si to daj osobitne do čistého FS/GM aby si si to odskúšal alebo už nwm..

Link to comment
Share on other sites

  • 0

Pickup funguj už :d

 

ale stejný systém na CP nefunguje.. :d

//Pilot
	//switch(pilotcp[playerid]) // "přehazuje" hodnotu proměny, nevím jak nazvat.
    {
        if(IsPlayerInSphere(playerid,1313.9821,1313.6451,11.7392,20))
        {
            DisablePlayerRaceCheckpoint(playerid);
            pilotcp[playerid]++;
			SetPlayerRaceCheckpoint(playerid,1, 2106.5129,-2424.2981,14.4659,2106.5129,-2424.2981,14.4659, 20);
			SCM(playerid, 0xFF9900ff,"[ MISE ] {FFFFFF}Nyní leť do San Fiera");
        }
        if(IsPlayerInSphere(playerid,2106.5129,-2424.2981,14.4659,20))
        //case 11:
        {
            DisablePlayerRaceCheckpoint(playerid);
            pilotcp[playerid]++;
            SetPlayerRaceCheckpoint(playerid,1,2106.5129,-2424.2981,14.4659,2106.5129,-2424.2981,14.4659,20);
            SCM(playerid, 0xFF9900ff,"[ MISE ] {FFFFFF}Nyní leť do Los Santos");
		}
  		if(IsPlayerInSphere(playerid,2106.5129,-2424.2981,14.4659,20))
        //case 11:
        {
            DisablePlayerRaceCheckpoint(playerid);
            pilotcp[playerid]++;
            SetPlayerRaceCheckpoint(playerid,1,1313.9821,1313.6451,11.7392,1313.9821,1313.6451,11.7392,20);
            SCM(playerid, 0xFF9900ff,"[ MISE ] {FFFFFF}Nyní leť do Las Venturas");
		}
		if(IsPlayerInSphere(playerid,1313.9821,1313.6451,11.7392,20))
  		//case 12:
        {
            DisablePlayerRaceCheckpoint(playerid);
            pilotcp[playerid]++;
            GivePlayerMoney(playerid, 50000);
            GameTextForAll("~w~Vydelal jsi~n~~r~50000$",5000,5);
		}
	}
	return 1;
}
Link to comment
Share on other sites

  • 0

Mám to v race.

ty cp ti nefunguji, protoze kdyz mas cp o velikosti 20 a seberes ho ,tak ses od neho dal nez 20. navic u cp zadny problem neni, tam to klidne muzes mit pres promeny, a bude ti to fungovat.

co se tyce tvych pickupu, tak ti to asi vzdy zastavi ty PickupOn a PickupIn nebo jak sis to pojmenoval, tak bud u nich smazat returny, nebo je dat pod IsPlayerInSphere.

a jnak co se tyce toho prohazovani, tak jsem daval do sekce ke stazeni include, kterej tu chybu opravuje, a muzes i nadale pouzivat styl if(pickupid == neco)

Edited by ATomas
  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...