Bug with teleportations with/without Vehicle. ‼!
#1

Hi all,

i have a bug in my server, when I teleport to a place EX : /taxi in san fierro
or every teleport ... It working and my car also teleport with it
but if I drive away from the place and some one do the same cmd (/taxi) it doesn't teleport he
but it re-teleport me to the last place, and after four attempts it teleport he finally (after 4 teleport me to /taxi) :P
Can some one give me the solution
PS: I can copy past here the TP if required
Reply
#2

Paste your /taxi command here.
Reply
#3

pawn Код:
if (strcmp("/taxi", cmdtext, true, 10) == 0)
    {

new State = GetPlayerState(playerid);
if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(vehicleid, 0);
SetPlayerInterior(playerid, 0);
SetVehicleZAngle(vehicleid,0);

return SetVehiclePos(vehicleid,-1990.7428,90.9115,27.6799);
}else{
SetPlayerPos(playerid,-1990.7428,90.9115,27.6799);
SetPlayerInterior(playerid, 0);
    }
  return 1;
    }
Every cmd for teleport, ALL them bug
Reply
#4

pawn Код:
if (strcmp("/taxi", cmdtext, true, 10) == 0)
    {

new state[playerid];
state[playerid] = GetPlayerState(playerid);
if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(vehicleid, 0);
SetPlayerInterior(playerid, 0);
SetVehicleZAngle(vehicleid,0);

return SetVehiclePos(vehicleid,-1990.7428,90.9115,27.6799);
}else{
SetPlayerPos(playerid,-1990.7428,90.9115,27.6799);
SetPlayerInterior(playerid, 0);
    }
  return 1;
    }
Try that, u might have to fix the indentation though.
Reply
#5

pawn Код:
pawntest.pwn(1060) : error 001: expected token: "-identifier-", but found "state"
pawntest.pwn(1061) : error 001: expected token: "-identifier-", but found "["
pawntest.pwn(1061) : error 029: invalid expression, assumed zero
pawntest.pwn(1061) : warning 215: expression has no effect
pawntest.pwn(1061) : error 001: expected token: ";", but found "]"
pawntest.pwn(1061) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
    }
Reply
#6

Change:
pawn Код:
new state[playerid];
to:
pawn Код:
new state[MAX_PLAYERS];
Reply
#7

Quote:
Originally Posted by O_x
The same errors !
Reply
#8

Quote:
Originally Posted by Yaszine
Quote:
Originally Posted by O_x
The same errors !
Which lines are 1060 and 1061 ?
Reply
#9

This

pawn Код:
new state[MAX_PLAYERS];
state[playerid] = GetPlayerState(playerid);
Reply
#10

pawn Код:
if (strcmp("/taxi", cmdtext, true, 10) == 0)
        {
          new State[MAX_PLAYERS];
            State[playerid] = GetPlayerState(playerid);
            if (IsPlayerInAnyVehicle(playerid) && State[playerid] == PLAYER_STATE_DRIVER)
            {
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
                SetPlayerInterior(GetPlayerVehicleID(playerid), 0);
                SetVehicleZAngle(GetPlayerVehicleID(playerid),0);
                return SetVehiclePos(GetPlayerVehicleID(playerid),-1990.7428,90.9115,27.6799);
            }
            else
            {
                SetPlayerPos(playerid,-1990.7428,90.9115,27.6799);
                SetPlayerInterior(playerid, 0);
            }
        return 1;
    }
This should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)