help teleport problem
#1

hi ive got a teleport want to add but its diff to ones i have in my pwn

these are ones i have in my pwn example
if (!strcmp("/derby", cmdtext, true))
{
SetPlayerPos2(playerid, -1167.8988, -1064.3848, 129.2188, 295.1862, cmdtext);
return 1;

and this one i want to add but giving me errors

if(strcmp(cmdtext, "/spiral", true) == 0) {
SetPlayerPos(playerid,947.219055, 142.820281, 302.127349);
return 1;
Reply
#2

Can you tell me what errors you have? Where the /derby takes place?
And only using SetPlayerPos will not be able to teleport players in a car.

I can help you with adding a derby.
Example:

pawn Код:
if(strcmp(cmdtext, "/derby", true) == 0) {
ResetPlayerWeapons(playerid);
if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
else SendClientMessage(playerid, red, "You need to be in a vehicle to use this command.");
return 1;
}
The ResetPlayerWeapons function prevents abuse of using TEC-9 in derbies.
If the derby takes place in an interior add:
pawn Код:
SetPlayerInterior(playerid, interiorid);
Get the interior IDs by going ingame and type /interior. Good Luck.

EDIT: Don't forget to place a } after return 1; or return 0;
You forgot that in your script. look at my examples to make the command and replace x y z with your coordinates.
Reply
#3

Here, this is for ya

Put this under OnGameModeInit.

Код:
	// Derby
	new DerbyBloodringBanger_1 = AddStaticVehicle(504,-1355.5416,936.6710,1036.1837,11.4329,1,1); // BloodringBanger
	new DerbyBloodringBanger_2 = AddStaticVehicle(504,-1350.6061,937.5493,1036.1947,12.4710,1,1); // BloodringBanger
	new DerbyBloodringBanger_3 = AddStaticVehicle(504,-1345.6512,938.5836,1036.2046,13.2675,1,1); // BloodringBanger
	new DerbyBloodringBanger_4 = AddStaticVehicle(504,-1340.6078,939.9857,1036.2150,17.2391,1,1); // BloodringBanger
	new DerbyBloodringBanger_5 = AddStaticVehicle(504,-1336.7312,941.1116,1036.2316,17.4418,1,1); // BloodringBanger
	new DerbyBloodringBanger_6 = AddStaticVehicle(504,-1331.5814,942.9241,1036.2539,20.6521,1,1); // BloodringBanger
  LinkVehicleToInterior(DerbyBloodringBanger_1,15);
  LinkVehicleToInterior(DerbyBloodringBanger_2,15);
  LinkVehicleToInterior(DerbyBloodringBanger_3,15);
  LinkVehicleToInterior(DerbyBloodringBanger_4,15);
  LinkVehicleToInterior(DerbyBloodringBanger_5,15);
  LinkVehicleToInterior(DerbyBloodringBanger_6,15);
And this is your teleport command. You put it under OnPlayerCommandText.


Код:
	if(strcmp(cmdtext, "/derby", true) == 0)
	{
    InCar[playerid] = false;
	  NormalTele(playerid, "Derby", -1441.9851,937.9876,1036.3468,  279.2885, -1424.1138,930.0392,1036.4016,354.8884,15);
      GetPlayerName(playerid, pName, sizeof(pName));
	  format(string, sizeof(string), "Teleport: %s has gone to The Derby (/derby)", pName);
	  SendClientMessageToAll(COLOR_YELLOW, string);
	  SetPlayerHealth(playerid, 100);
	  ResetPlayerWeapons(playerid);
		return 1;
	}
This is the derby arena, cars are in and you teleport there and hop in. That's it, hope it will work..it should..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)