marker help please
#1

if i go to any marker with car then its teleports only myself

but how i can make marker what teleports car too?
Reply
#2

SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);

change x y z to your coords



Helped?
Reply
#3

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if (newkeys == 16)
	{
		if(IsInandromana[playerid] > 0)
		{
			new Float:X,Float:Y,Float:Z;
			GetVehiclePos(IsInandromana[playerid], X, Y, Z);
      SetVehiclePos(GetPlayerVehicleID(playerid, X+4, Y, Z);
			SetPlayerPos(playerid, X+4, Y, Z);
			SetPlayerInterior(playerid, 0);
			IsInandromana[playerid]=0;
			SetPlayerColor(playerid,COLOR_GREY);
		}
	}
	return 1;
}
error:
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(111) : warning 202: number of arguments does not match definition
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(111) : warning 202: number of arguments does not match definition
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(111) : warning 202: number of arguments does not match definition
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(111) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Quote:
Originally Posted by rs2fun111
Код:
      SetVehiclePos(GetPlayerVehicleID(playerid, X+4, Y, Z);
pawn Код:
new Float:vX, Float:vY, Float:vZ;
GetVehiclePos(GetPlayerVehicleID(playerid), vX, vY, vZ);
SetVehiclePos(GetPlayerVehicleID(playerid), vX+4, vY, vZ);
Untested, but should compile without problems.
Reply
#5

but if i go to marker then it isnt teleport player too only teleports car
Код:
public OnPlayerEnterCheckpoint(playerid)
{
        DisablePlayerCheckpoint(playerid);
        new string[256];
        new name[128];
        GetPlayerName(playerid,name,128);
        SendClientMessageToAll(COLOR_GREEN, string);
			  new Float:X,Float:Y,Float:Z;
			  GetVehiclePos(IsInandromana[playerid], X, Y, Z);
			  SetPlayerPos(playerid, X+4, Y, Z);
			  new Float:vX, Float:vY, Float:vZ;
        GetVehiclePos(GetPlayerVehicleID(playerid), vX, vY, vZ);
        SetVehiclePos(GetPlayerVehicleID(playerid), vX+4, vY, vZ);
        SetPlayerInterior(playerid, 0);
        SetPlayerColor(playerid,COLOR_PLAYER);
        return;
}
Reply
#6

Quote:
Originally Posted by rs2fun111
but if i go to marker then it isnt teleport player too only teleports car
Код:
public OnPlayerEnterCheckpoint(playerid)
{
        DisablePlayerCheckpoint(playerid);
        new string[256];
        new name[128];
        GetPlayerName(playerid,name,128);
        SendClientMessageToAll(COLOR_GREEN, string);
			  new Float:X,Float:Y,Float:Z;
			  GetVehiclePos(IsInandromana[playerid], X, Y, Z);
			  SetPlayerPos(playerid, X+4, Y, Z);
			  new Float:vX, Float:vY, Float:vZ;
        GetVehiclePos(GetPlayerVehicleID(playerid), vX, vY, vZ);
        SetVehiclePos(GetPlayerVehicleID(playerid), vX+4, vY, vZ);
        SetPlayerInterior(playerid, 0);
        SetPlayerColor(playerid,COLOR_PLAYER);
        return;
}
Then use SetPlayerPos instead.
Example:

pawn Код:
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid pX, pY, pZ);
SetPlayerPos(playerid, pX+4, pY, pZ);
Reply
#7

but i want it teleports car with player

Reply
#8

Quote:
Originally Posted by rs2fun111
but i want it teleports car with player

Hmm.... usually it should have worked with SetVehiclePos. Then use this:

pawn Код:
new Float:pX, Float:pY, Float:pZ, pV;

pV=GetPlayerVehicleID(playerid);

GetPlayerPos(playerid pX, pY, pZ);

new Float:vX, Float:vY, Float:vZ;

GetVehiclePos(GetPlayerVehicleID(playerid), vX, vY, vZ);

SetVehiclePos(GetPlayerVehicleID(playerid), vX+4, vY, vZ);
SetPlayerPos(playerid, pX+4, pY, pZ);
PutPlayerInVehicle(playerid, pV);
Cheers.
Reply
#9

code is now

Код:
public OnPlayerEnterCheckpoint(playerid)
{
        DisablePlayerCheckpoint(playerid);
        new string[256];
        new name[128];
        GetPlayerName(playerid,name,128);
        SendClientMessageToAll(COLOR_GREEN, string);
        new Float:pX, Float:pY, Float:pZ, pV;
        pV=GetPlayerVehicleID(playerid);
        GetPlayerPos(playerid pX, pY, pZ);
        new Float:vX, Float:vY, Float:vZ;
        GetVehiclePos(GetPlayerVehicleID(playerid), vX, vY, vZ);
        SetVehiclePos(GetPlayerVehicleID(playerid), vX+4, vY, vZ);
        SetPlayerPos(playerid, pX+4, pY, pZ);
        PutPlayerInVehicle(playerid, pV);
        SetPlayerInterior(playerid, 0);
        SetPlayerColor(playerid,COLOR_PLAYER);
        return;
}
Error

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(78) : error 001: expected token: ",", but found "-identifier-"
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(78) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(78) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(78) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(78) : error 001: expected token: ";", but found ")"
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(78) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\andromanaint.pwn(78) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#10

remove these 3
pV=GetPlayerVehicleID(playerid);
SetPlayerPos(playerid, pX+4, pY, pZ);
PutPlayerInVehicle(playerid, pV);
and which is line 78?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)