CP HELP
#1

How to delete last CP,if player finish ?

Код:
#include <a_samp>
#include <core>
#include <float>
#include <dutils>
#include <dudb>
#pragma tabsize 0;
#pragma unused ret_memcpy
/*co potřebuji:
Kdyћ zapne misi mělo by ho to zmrazi a odmrazit na vљech Checkpointech,ale zmrazн
to pouuze ID 0 a ID 1 a vнљ to zmrazн ale neodmrazн.
A u ID 0 ho to nezmrazuje na vљechn pointech ale na kaћdйm druhйm (zmraћeni na 5 sekund).
A proto potřebuji aby to ID 1 a vнљ zmrazilo a odmrazilo na vљech Checkpoint a psalo zprбvu kam mб dбl jet


*/
#define COLOR_BILA       0xFFFFFFAA
//newy
new Job[MAX_PLAYERS];
new jede[MAX_PLAYERS];
new Mise1CP[MAX_PLAYERS];
new vyplata[MAX_PLAYERS];
new neco[MAX_PLAYERS];
new konec[MAX_PLAYERS];
//forward
forward zastaveni(playerid);

public OnPlayerConnect(playerid)
{
	jede[playerid] = 0;
	Mise1CP[playerid] = 0;
	vyplata[playerid] = 0;
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	Mise1CP[playerid] = 0;
	jede[playerid] = 0;
	vyplata[playerid] = 0;
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/gmise", cmdtext, true, 10) == 0)
	{
	
			new string[256];
			format(string,sizeof(string),"CLEAR\r\n");
			ShowPlayerDialog(playerid,300,DIALOG_STYLE_LIST,"Mise",string,"Vybrat","Storno");
		}

	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	if (jede[playerid] == 1)
	{
		switch(Mise1CP[playerid])
		{
	  		case 0:
  		 	{
  		 	    neco[playerid] = 1;
	      	  	SetPlayerCheckpoint(playerid, 2081.8428,1798.0490,10.5475, 10);
	      	  	SendClientMessage(playerid,COLOR_BILA,"Jsi v checkpointu 1");
	      	 	Mise1CP[playerid] = 1;
				TogglePlayerControllable(playerid, 0);
				SetTimer("zastaveni",5000,true);
			}
	   		case 1:
	   		{
	   		    neco[playerid] = 1;
	        	SetPlayerCheckpoint(playerid, 2013.1017,1720.0950,10.5474, 10);
	        	SendClientMessage(playerid,COLOR_BILA,"Jsi v checkpointu 2");
	        	Mise1CP[playerid] = 2;
	        	TogglePlayerControllable(playerid, 0);
				SetTimer("zastaveni",5000,true);
	    	}
  	  		case 2:
	    	{
                neco[playerid] = 1;
				SetPlayerCheckpoint(playerid, 2035.5901,1672.2506,10.5474, 10);
	        	Mise1CP[playerid] = 3;
	        	TogglePlayerControllable(playerid, 0);
				SetTimer("zastaveni",5000,true);
	    	}
	    	case 3:
	    	{
	    		neco[playerid] = 1;
	        	SetPlayerCheckpoint(playerid, 1757.0643,1445.5385,11.9404, 10);
	        	Mise1CP[playerid] = 4;
	        	TogglePlayerControllable(playerid, 0);
				SetTimer("zastaveni",5000,true);
	    	}
	    	case 4:
	    	{
	    	    neco[playerid] = 1;
	    	    konec[playerid] = 1;
				TogglePlayerControllable(playerid, 0);
				SetTimer("zastaveni",5000,true);
	    	}
    	}
	}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 300)
	{
		if(response == 1)
		{
			if(listitem == 0)
			{
				if(jede[playerid] == 0)
				{
					SendClientMessage(playerid, COLOR_BILA, "*[Ředitelstvн]* Vyjel jsi Čistenн chodnнku, řiď se checkpointy.");
					SetPlayerCheckpoint(playerid, 2114.2405,1958.0293,10.5811,5);
					jede[playerid] = 1;
					Mise1CP[playerid] = 0;
					new vehicleid = GetPlayerVehicleID(playerid);
                    SetVehiclePos(574, 2114.2405,1958.0293,10.5811);
                    SetPlayerPos(playerid, 2114.2405,1958.0293,10.5811);
                    new Car;

    Car = CreateVehicle(574,2114.2405,1958.0293,10.5811,1,1);
    PutPlayerInVehicle(playerid,Car,0);
         		}
			}
		}
	}
	return 1;
}

public zastaveni(playerid)
{
	if(jede[playerid] == 1)
	{
		if(neco[playerid] == 1)
		{
    		SendClientMessage(playerid,COLOR_BILA,"*[Něco]* Jsi odmrazen");
			TogglePlayerControllable(playerid, 1);
			neco[playerid] = 0;
		}
	}
	return 1;
}
Reply


Messages In This Thread
CP HELP - by itachi - 11.03.2017, 19:19
Re: CP HELP - by coool - 12.03.2017, 10:02

Forum Jump:


Users browsing this thread: 1 Guest(s)