SA-MP Forums Archive
Tele cmd Problem..HELP please =] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Tele cmd Problem..HELP please =] (/showthread.php?tid=65646)



Tele cmd Problem..HELP please =] - XnicozX - 14.02.2009

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;
     }



Re: Tele cmd Problem..HELP please =] - hoodline - 14.02.2009

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)



Re: Tele cmd Problem..HELP please =] - XnicozX - 14.02.2009

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 .. ?


Re: Tele cmd Problem..HELP please =] - Daren_Jacobson - 15.02.2009

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


Re: Tele cmd Problem..HELP please =] - Joe Staff - 15.02.2009

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


Re: Tele cmd Problem..HELP please =] - Kanji_Suzuki - 15.02.2009

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;
     }
  }



Re: Tele cmd Problem..HELP please =] - XnicozX - 15.02.2009

hmm.. none of this work... it gives about 13 errors


Re: Tele cmd Problem..HELP please =] - Guziiinho - 15.02.2009

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.


Re: Tele cmd Problem..HELP please =] - XnicozX - 15.02.2009

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