Tele cmd Problem..HELP please =]
#1

Can someone please help me ?
Err.. The problem is .. When you type /drift u get teleported to
a drift place. But when u type /drift2 u get teled to the same place, which it's not supposed to.
Can u tell me whats wrong?:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/drift", cmdtext, true, 6) == 0)
     {
        new vehicleid = GetPlayerVehicleID(playerid);
        new State = GetPlayerState(playerid);
        if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
     {
        return SetVehiclePos(vehicleid,-312.5042,1539.6537,75.5625);
     }
        SetPlayerPos(playerid,-312.5042,1539.6537,75.5625);
        return 1;
     }
    if(strcmp("/drift2", cmdtext, true, 7) == 0)
     {
        new vehicleid = GetPlayerVehicleID(playerid);
        new State = GetPlayerState(playerid);
        if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
     {
        return SetVehiclePos(vehicleid,-290.5271,1742.3457,42.6875);
     }
        SetPlayerPos(playerid,-290.5271,1742.3457,42.6875);
        return 1;
     }
Reply
#2

drift = 5 letters
drift2 = 6

change:

pawn Код:
if(strcmp("/drift", cmdtext, true, 6) == 0)
and
if(strcmp("/drift2", cmdtext, true, 7) == 0)
To

pawn Код:
if(strcmp("/drift", cmdtext, true, 5) == 0)
and
if(strcmp("/drift2", cmdtext, true, 6) == 0)
Reply
#3

Quote:
Originally Posted by hoodline
drift = 5 letters
drift2 = 6

change:

pawn Код:
if(strcmp("/drift", cmdtext, true, 6) == 0)
and
if(strcmp("/drift2", cmdtext, true, 7) == 0)
To

pawn Код:
if(strcmp("/drift", cmdtext, true, 5) == 0)
and
if(strcmp("/drift2", cmdtext, true, 6) == 0)
Okai, I changed it like u said. But it still teleports me to the same location
Have any idea what else it could be .. ?
Reply
#4

change it to
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/drift2", cmdtext, true, 7) == 0)
     {
        new vehicleid = GetPlayerVehicleID(playerid);
        new State = GetPlayerState(playerid);
        if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
     {
        return SetVehiclePos(vehicleid,-290.5271,1742.3457,42.6875);
     }
        SetPlayerPos(playerid,-290.5271,1742.3457,42.6875);
        return 1;
    if(strcmp("/drift", cmdtext, true, 6) == 0)
     {
        new vehicleid = GetPlayerVehicleID(playerid);
        new State = GetPlayerState(playerid);
        if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
     {
        return SetVehiclePos(vehicleid,-312.5042,1539.6537,75.5625);
     }
        SetPlayerPos(playerid,-312.5042,1539.6537,75.5625);
        return 1;
     }
     }
reverse order, hint, use dcmd, it helps...alot
Reply
#5

or get rid of the ",5" and ",6" completely, it's not required.
Reply
#6

try this but i think they Have to be in a car to tp

Код:
  
  if(strcmp("/drift", cmdtext, true, 6) == 0)
  {
  new vehicleid = GetPlayerVehicleID(playerid);
  new State = GetPlayerState(playerid);
  if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
  {
	  SetVehiclePos(vehicleid,-312.5042,1539.6537,75.5625);
	  SetPlayerPos(playerid,-312.5042,1539.6537,75.5625);
         return 1;
         }
  }
  if(strcmp("/drift2", cmdtext, true, 7) == 0)
  {
  new vehicleid = GetPlayerVehicleID(playerid);
  new State = GetPlayerState(playerid);
  if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
  {
        SetVehiclePos(vehicleid,-290.5271,1742.3457,42.6875);
        SetPlayerPos(playerid,-290.5271,1742.3457,42.6875);
        return 1;
     }
  }
Reply
#7

hmm.. none of this work... it gives about 13 errors
Reply
#8

It happen with me one time with the command "/hitman" this command was to put a hit on someone , but somehow it executes the animation /hit , so , I change it to /contracthit , but a needed to change /contracthit in others place of the GM , I could help you if you post the WHOLE GM .

hope i help.
Reply
#9

Sorry, cant do that. Any suggestions on what might be wrong.....?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)