Little problem
#1

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
Reply
#2

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.");
Reply
#3

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
Reply
#4

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

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 :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)