Jump to content
  • 0

pomoc Tlacitko teleport


MegaTheVova

Dotaz

	if(!strcmp(cmdtext, "/s", true))
{
	if(IsPlayerInAnyVehicle(playerid))
	{
        new vehicleid = GetPlayerVehicleID(playerid);
		GetVehiclePos(vehicleid, posX[playerid], posY[playerid], posZ[playerid]);
		GetVehicleZAngle(vehicleid, posA[playerid]);
	}
	else
	{
	    GetPlayerPos(playerid, posX[playerid], posY[playerid], posZ[playerid]);
		GetPlayerFacingAngle(playerid, posA[playerid]);
	}
	Interior[playerid] = GetPlayerInterior(playerid);
 	VirtualWorld[playerid] = GetPlayerVirtualWorld(playerid);
	SendClientMessage(playerid, -1, "{FFFFFF}[{3399FF}Aw{FFFFFF}]{3399FF}:{FFFFFF} You have saved your position");
	SendClientMessage(playerid, -1, "{FFFFFF}[{3399FF}Aw{FFFFFF}]{3399FF}:{FFFFFF} Type {3399FF}/r {FFFFFF}or press {3399FF}Y {FFFFFF}to load your position");
	Saved[playerid] = 1;
	return 1;
}

	if(!strcmp(cmdtext, "/r", true))
{
	if(Saved[playerid] == 1)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			new vehicleid = GetPlayerVehicleID(playerid);
		    SetVehiclePos(vehicleid, posX[playerid], posY[playerid], posZ[playerid]);
			SetVehicleZAngle(vehicleid, posA[playerid]);
		 	LinkVehicleToInterior(vehicleid, Interior[playerid]);
		 	SetVehicleVirtualWorld(vehicleid, VirtualWorld[playerid]);
		}
		else
		{
		    SetPlayerPos(playerid, posX[playerid], posY[playerid], posZ[playerid]);
		    SetPlayerFacingAngle(playerid, posA[playerid]);
		    SetPlayerInterior(playerid, Interior[playerid]);
		 	SetPlayerVirtualWorld(playerid, VirtualWorld[playerid]);
		}
		SendClientMessage(playerid, -1, "{FFFFFF}[{3399FF}Aw{FFFFFF}]{3399FF}:{FFFFFF} You have loaded your position");
	}
	else
	{
	    SendClientMessage(playerid, -1, "{FFFFFF}[{FF0000}Aw{FFFFFF}]{FF0000}: {FFFFFF} You cant do that since you have not saved any positions yet");
	    SendClientMessage(playerid, -1, "{FFFFFF}[{3399FF}Aw{FFFFFF}]{3399FF}:{FFFFFF} Type {3399FF}/s {FFFFFF}to save a position");
	}
	return 1;
}

ahoj :) potreboval bych pomoct jak muzu udelat tak abych mohl tlacitko ''Y'' pouzivat jako to /r jakoze vratit na ulozenou pozici kdyz jsem to zkousel

if(newkeys == KEY_YES)

{

vlozil jsem funkci /r

tak mi to nahazelo hodne chyb :/

Link to comment
Share on other sites

5 odpovědí na tuto otázku

Recommended Posts

  • 0
if(newkeys & KEY_YES)
{
    obsah prikazu r
}

rozdil mezi tvym zapisem a jeho je ten ze v jeho pripade musis drzet jenom Y ale v tom tvem k tomu Y muzes drzet i jine klavesy.

 

kazdopadne to co mas v tom prikazu /r hod do te podminky s tou klavesou to jsi udelal dobre.

Edited by ATomas
Link to comment
Share on other sites

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