Jump to content

Recommended Posts

Posted
Descriere tutorial:Vreau sa ma ajutati si pe mine cu comanda work, vreau ca atunci cand folosesc comanda /work sa ma spawneze o masina pentru fiecare job.
EX.
Am jobul Pizza boy, dau /work imi spawneaza un scuter de pizza si in momentul in care ma dau jos din masina sa imi despawneze masina.
  • 1 month later...
Posted

Salut:

Adaugi pe undeva pe la inceput:

new ActiveJob[MAX_PLAYERS];

Apoi:

la OnPlayerConnect()
ActiveJob[playerid] = 0;

la OnPlayerDisconnect()
ActiveJob[playerid] = 0;

Si acum comanda:

CMD:work(playerid, params[])
{
	if(!IsPlayerConnected(playerid)) SendClientMessage(playerid,-1,"Trebuie sa fii conectat pentru a folosi comanda");
	if(PData[playerid][pJob] == 0)  SendClientMessage(playerid,-1,"Tu nu detii un job !");
	if(PData[playerid][pJob] == 1)
	{
		new veh, Float:pos[3];
		GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		veh = AddStaticVehicle(448, pos[0], pos[1], pos[2], -1, -1);
		ActiveJob[playerid] = 1;
		PutPlayerInVehicle(playerid, veh, 0);
		SendClientMessage(playerid,-1,"Ai inceput munca");
	}
	
	if(PData[playerid][pJob] == 2)
	{
		new veh, Float:pos[3];
		GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		veh = AddStaticVehicle(448, pos[0], pos[1], pos[2], -1, -1);
		ActiveJob[playerid] = 2;
		PutPlayerInVehicle(playerid, veh, 0);
		SendClientMessage(playerid,-1,"Ai inceput munca");
	}
	return 1;
}

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.