Jump to content
  • 0

Problema "intoarcete la autovehicul in 30 de secunde"


Buckzor

Question

Cum pot face atunci cand parasesti masina de job sa iti trimita un mesaj in chat cum ca trebuie sa te intorci la bicicleta in maxim 30 de secunde altfel aceea se va distruge?

eu am incercat asta dar degeaba ma urc inapoi pe ea ca tot mi-o distruge

public OnPlayerExitVehicle(playerid, vehicleid)
{
	if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
	{
		SetTimerEx("ZiarDestroy", 3000, false, "i", playerid);
		SCM(playerid, 0x00e1edFF, "(Job): {FFFFFF}Ai 30 de secunde sa te intorci la bicicleta altfel jobul tau va fi anulat.");
	}
	return 1;
}

forward ZiarDestroy(playerid);
public ZiarDestroy(playerid)
{
	SCM(playerid, 0x00e1edFF, "(Job): {ffffff}Munca ta a esuat! Motiv: Ai parasit bicicleta!");
	DestroyVehicle(masinaziar[playerid]);
	masinaziar[playerid] = 0;
	JobWorking[playerid] = 0;
	DisablePlayerCheckpoint(playerid);
	CpZiar[playerid] = 0;
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Acum 10 ore, Buckzor a spus:

Cum pot face atunci cand parasesti masina de job sa iti trimita un mesaj in chat cum ca trebuie sa te intorci la bicicleta in maxim 30 de secunde altfel aceea se va distruge?

eu am incercat asta dar degeaba ma urc inapoi pe ea ca tot mi-o distruge


public OnPlayerExitVehicle(playerid, vehicleid)
{
	if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
	{
		SetTimerEx("ZiarDestroy", 3000, false, "i", playerid);
		SCM(playerid, 0x00e1edFF, "(Job): {FFFFFF}Ai 30 de secunde sa te intorci la bicicleta altfel jobul tau va fi anulat.");
	}
	return 1;
}

forward ZiarDestroy(playerid);
public ZiarDestroy(playerid)
{
	SCM(playerid, 0x00e1edFF, "(Job): {ffffff}Munca ta a esuat! Motiv: Ai parasit bicicleta!");
	DestroyVehicle(masinaziar[playerid]);
	masinaziar[playerid] = 0;
	JobWorking[playerid] = 0;
	DisablePlayerCheckpoint(playerid);
	CpZiar[playerid] = 0;
}

 

Sterge if ul in care  verifici daca e sofer. Acest callback se apeleaza cand jucarorul coboara din masini, adica GetPlayerState=PLAYER_STATE_ONFOOT

Trebuie sa faci o verificate la OnPlayerEnterVehicle sa distrugi timerul daca se urca mai repede pt ca altfel va distruge masina chiar daca se urca in ea

Edited by valivaly96
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
Answer this question...

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