Jump to content

Tutorial /work


.RuNNeR.

Recommended Posts

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.
Link to comment
Share on other sites

  • 1 month later...

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;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.