teleport help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: teleport help (
/showthread.php?tid=382818)
teleport help -
Socan - 05.10.2012
So I made this teleport and for some reason i'm getting errors; can anyone help.
pawn Код:
CMD:mhill(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid) == 1)
{
SetPlayerInterior(playerid, 0);
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),-2489.6118,-615.7424,132.1036);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 310.2000);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
}
else
{
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
}
else
{
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
}
}
return 1;
}
These are the warnings I get
Код:
C:\Users\School\Desktop\Drift soon to be\gamemodes\drift.pwn(950) : warning 217: loose indentation
C:\Users\School\Desktop\Drift soon to be\gamemodes\drift.pwn(950) : error 029: invalid expression, assumed zero
C:\Users\School\Desktop\Drift soon to be\gamemodes\drift.pwn(958) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Re: teleport help -
Danyal - 05.10.2012
pawn Код:
CMD:mhill(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),-2489.6118,-615.7424,132.1036);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 310.2000);
SetPlayerInterior(playerid, 0);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
}
else
{
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
}
return 1;
}
Re: teleport help -
CaRa - 05.10.2012
Place it at the top of gamemode.
Post line 950 and 958
Re: teleport help -
Socan - 05.10.2012
That is line 950 and 958.
Re: teleport help -
CaRa - 05.10.2012
Код:
CMD:mhill(playerid, params[])
{
if (GetPlayerState(playerid) == 2)
{
SetVehiclePos(GetPlayerVehicleID(playerid),-2489.6118,-615.7424,132.1036);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 310.2000);
SetPlayerInterior(playerid, 0);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
}
else
{
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
}
SendClientMessage(playerid, COLOR_GRAD1, "You have been teleported to San Fierro Station !");
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
return 1;
}
Re: teleport help -
Danyal - 05.10.2012
tried my code??
Re: teleport help -
Socan - 05.10.2012
Yes, it worked perfectly.