Jump to content
  • 0

Nu se intampla nimic cand apas tasta "N"


FeLLiX*

Question

Problema intalnita (descriere): Am gasit un job pe net, si l-am trecut in gm, iar cand il pun merge totul ok, doar ca in joc cand trebuie sa apas tasta "N" nu se intampla nimic
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu): 

/////////////job gift=========================================================
	new stringg[500];
     if(newkeys == KEY_NO) //
        {
     	 if(Working[playerid] == -1) return 1;
		if(IsPlayerInAnyVehicle(playerid)) return 1;
	    if(Vehiclee1[playerid] == -1 && Working[playerid] == 1) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "* You must to climb in a vehicle and after upload gifts.");
	    //if(CheckPlayerDistanceToVehicle(5.0, playerid, Vehicle[playerid])) {
	    if(IsPlayerConnected(playerid)) {
		    RemovePlayerAttachedObject(playerid, 5);
			if(TotalGifts[playerid] == 0) return 1;
		    if(GiftHand[playerid] == -1) {
				GiftHand[playerid] = 1;
				SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
				new rand = random(4), gift;
				if(rand == 0) gift = 19054;
				else if(rand == 1) gift = 19055;
				else if(rand == 2) gift = 19056;
				else if(rand == 3) gift = 19057;
				else if(rand == 4) gift = 19058;
			    SetPlayerAttachedObject( playerid, 5, gift, 1, 0.179536, 0.436568, -0.047055, 0.000000, 84.821968, 77.998138, 0.405070, 1.000000, 0.225547 );
		        SendClientMessage(playerid, COLOR_WHITE, "* You have took one gift from your vehicle!");
		    }
		    else if(GiftHand[playerid] == 1) {
				GiftHand[playerid] = -1;
				RemovePlayerAttachedObject(playerid, 5);
				SetPlayerSpecialAction(playerid, 0);
		        SendClientMessage(playerid, COLOR_WHITE, "* You have put the gift in your vehicle!");
				if(TotalGifts[playerid] < 9 && Checkpoint[playerid] == -1) {
				    format(stringg, sizeof(stringg), "{FFBC63}Want to get gifts?\nCurrently, you have only {94FF63}%d gifts{FFFFFF}.", TotalGifts[playerid]);
				    ShowPlayerDialog(playerid, DIALOG_STATUS, DIALOG_STYLE_MSGBOX, " ", stringg, "Yes", "No");
				}
				if(Gifts[playerid] == 10) {
				    format(stringg, sizeof(stringg), "{FFBC63}Congratulations, {638DFF}%s{FFBC63}!\nYou have {94FF63}finished{FFBC63} the step one. Next step consist to distrbuite gifts on different houses. Success!", GetName(playerid));
				    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, " ", stringg, "Okay", "");
					new rand = random(sizeof(HousePos));
					SetPlayerCheckpoint(playerid, HousePos[rand][0] ,HousePos[rand][1], HousePos[rand][2], 2.0);
					format(stringg, sizeof(stringg), "You have still %d gifts distributed!", Gifts[playerid]);
					SendClientMessage(playerid, 0xFFFF00FF, stringg);
					Checkpoint[playerid] = 1;
				}
		    }
		}
		else if(IsPlayerInRangeOfPoint(playerid, 5.0,2779.7212, -2448.8000, 13.1382) || IsPlayerInRangeOfPoint(playerid, 5.0,2787.8457, -2449.8621, 13.1382)
		|| IsPlayerInRangeOfPoint(playerid, 5.0,2787.8457, -2462.6228, 13.1382) || IsPlayerInRangeOfPoint(playerid, 5.0,2779.9548, -2462.6294, 13.1382)) {
			if(Gifts[playerid] == 10) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "* You have a maximum gifts (10).");
			if(GiftHand[playerid] == 1) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "* You already have a gift in your hands!");
			Gifts[playerid] ++;
			TotalGifts[playerid] ++;
			new rand = random(4), gift;
			if(rand == 0) gift = 19054;
			else if(rand == 1) gift = 19055;
			else if(rand == 2) gift = 19056;
			else if(rand == 3) gift = 19057;
			else if(rand == 4) gift = 19058;
		    SetPlayerAttachedObject( playerid, 5, gift, 1, 0.179536, 0.436568, -0.047055, 0.000000, 84.821968, 77.998138, 0.405070, 1.000000, 0.225547 );
			SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
			GiftHand[playerid] = 1;
		}
	}
			/////////////////////////////////


Imagini / Video (optional):-
Ati incercat sa rezolvati singur?:  Am incercat sa fac o comanda macar daca nu merge asa, dar nu prea mi-a iesit, sunt incepator.. nu ma judecati...

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

La publicul OnPlayerKeyStateChange 

Ai mai folosit butonul si la final are return 1 iar asta nu permite sa folosesti iar butonul, deci incearca sa il pui sus de tot adica exact dupa public ca sa nu se opreasca la celalalt

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

folosesti un vehicul pentru job?

pentru ca aici zice

if(IsPlayerInAnyVehicle(playerid)) return 1;

si trebuie modificat in 

if(!IsPlayerInAnyVehicle(playerid)) return 1;

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Intra in masina jobului si vezi daca merge apasa N,daca nu ai o masina a jobului fa asa:

/////////////job gift=========================================================
     if(newkeys == KEY_NO) //
        {
		 new stringg[500];
     	 if(Working[playerid] == -1) return 1;
	     if( Working[playerid] == 1) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "* You must to climb in a vehicle and after upload gifts.");
	    //if(CheckPlayerDistanceToVehicle(5.0, playerid, Vehicle[playerid])) {
	    if(IsPlayerConnected(playerid)) {
		    RemovePlayerAttachedObject(playerid, 5);
			if(TotalGifts[playerid] == 0) return 1;
		    if(GiftHand[playerid] == -1) {
				GiftHand[playerid] = 1;
				SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
				new rand = random(4), gift;
				if(rand == 0) gift = 19054;
				else if(rand == 1) gift = 19055;
				else if(rand == 2) gift = 19056;
				else if(rand == 3) gift = 19057;
				else if(rand == 4) gift = 19058;
			    SetPlayerAttachedObject( playerid, 5, gift, 1, 0.179536, 0.436568, -0.047055, 0.000000, 84.821968, 77.998138, 0.405070, 1.000000, 0.225547 );
		        SendClientMessage(playerid, COLOR_WHITE, "* You have took one gift from your vehicle!");
		    }
		    else if(GiftHand[playerid] == 1) {
				GiftHand[playerid] = -1;
				RemovePlayerAttachedObject(playerid, 5);
				SetPlayerSpecialAction(playerid, 0);
		        SendClientMessage(playerid, COLOR_WHITE, "* You have put the gift in your vehicle!");
				if(TotalGifts[playerid] < 9 && Checkpoint[playerid] == -1) {
				    format(stringg, sizeof(stringg), "{FFBC63}Want to get gifts?\nCurrently, you have only {94FF63}%d gifts{FFFFFF}.", TotalGifts[playerid]);
				    ShowPlayerDialog(playerid, DIALOG_STATUS, DIALOG_STYLE_MSGBOX, " ", stringg, "Yes", "No");
				}
				if(Gifts[playerid] == 10) {
				    format(stringg, sizeof(stringg), "{FFBC63}Congratulations, {638DFF}%s{FFBC63}!\nYou have {94FF63}finished{FFBC63} the step one. Next step consist to distrbuite gifts on different houses. Success!", GetName(playerid));
				    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, " ", stringg, "Okay", "");
					new rand = random(sizeof(HousePos));
					SetPlayerCheckpoint(playerid, HousePos[rand][0] ,HousePos[rand][1], HousePos[rand][2], 2.0);
					format(stringg, sizeof(stringg), "You have still %d gifts distributed!", Gifts[playerid]);
					SendClientMessage(playerid, 0xFFFF00FF, stringg);
					Checkpoint[playerid] = 1;
				}
		    }
		}
		else if(IsPlayerInRangeOfPoint(playerid, 5.0,2779.7212, -2448.8000, 13.1382) || IsPlayerInRangeOfPoint(playerid, 5.0,2787.8457, -2449.8621, 13.1382)
		|| IsPlayerInRangeOfPoint(playerid, 5.0,2787.8457, -2462.6228, 13.1382) || IsPlayerInRangeOfPoint(playerid, 5.0,2779.9548, -2462.6294, 13.1382)) {
			if(Gifts[playerid] == 10) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "* You have a maximum gifts (10).");
			if(GiftHand[playerid] == 1) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "* You already have a gift in your hands!");
			Gifts[playerid] ++;
			TotalGifts[playerid] ++;
			new rand = random(4), gift;
			if(rand == 0) gift = 19054;
			else if(rand == 1) gift = 19055;
			else if(rand == 2) gift = 19056;
			else if(rand == 3) gift = 19057;
			else if(rand == 4) gift = 19058;
		    SetPlayerAttachedObject( playerid, 5, gift, 1, 0.179536, 0.436568, -0.047055, 0.000000, 84.821968, 77.998138, 0.405070, 1.000000, 0.225547 );
			SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
			GiftHand[playerid] = 1;
		}
	}
Edited by Adrian_Petre

 

 

Link to comment
Share on other sites

  • 0
Guest
This topic is now closed to further replies.
×
×
  • 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.