SA-MP Forums Archive
Little problem - 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: Little problem (/showthread.php?tid=147775)



Little problem - [XST]O_x - 14.05.2010

hey,i made this noobie thingy:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if ((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION))
  {
    if (IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_GREEN,"You are already in a vehicle.");
    else
    {
            new Float:x, Float:y, Float:z;
            new Float:Angle;
            new CarINF;
            GetPlayerFacingAngle(playerid, Angle);
            GetPlayerPos(playerid,x,y,z);
            CarINF = CreateVehicle(411,x,y,z,Angle,-1,-1,300);
            PutPlayerInVehicle(playerid,CarINF,0);
        }
    }
    return 1;
}
well,it's not working as most of the stuff i try to make XD.
but the car spawn thing works great,it puts me and the vehicle and everything,the problem is,that if i'm already
inside a car,it doesn't send the message.any help?
thank in advance :P


Re: Little problem - Norck - 14.05.2010

Try to put this:
pawn Код:
if (IsPlayerInAnyVehicle(playerid))
{
  SendClientMessage(playerid,COLOR_GREEN,"You are already in a vehicle.");
  return 1;
}
Instead of this:
pawn Код:
if (IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_GREEN,"You are already in a vehicle.");



Re: Little problem - [XST]O_x - 14.05.2010

Quote:
Originally Posted by Sinyavski
Try to put this:
pawn Код:
if (IsPlayerInAnyVehicle(playerid))
{
  SendClientMessage(playerid,COLOR_GREEN,"You are already in a vehicle.");
  return 1;
}
Instead of this:
pawn Код:
if (IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_GREEN,"You are already in a vehicle.");
uhmm still not working :S
thanks for trying to help anyway


Re: Little problem - Norck - 14.05.2010

And does it spawn a new vehicle and puts you in, if you are already inside other vehicle?


Re: Little problem - [XST]O_x - 14.05.2010

Quote:
Originally Posted by Sinyavski
And does it spawn a new vehicle and puts you in, if you are already inside other vehicle?
nope,just doesn't send the message .
EDIT: Solved,i'm so dumb :/