SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 20/09/2009, 06:00 PM   #1
yugokoral
Big Clucker
 
Join Date: Aug 2008
Posts: 107
Reputation: 0
Default Car doors locked animation (Need help to apply animation)

I want to make a script. Now i have lock and unlock command for car. When the car is locked from somewho, than other players can not enter the vehicle, but they not play the animation for locked doors. So i want to add this:

theres an standard lock unlock command under OnPlayerCommandText:
pawn Code:
if (strcmp(cmdtext, "/lock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid, GREY,"You can only lock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                if(i != playerid)
                {
                    SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
                }
            }
            new Float:X,Float:Y,Float:Z;
            SendClientMessage(playerid, GREY, "Vehicle locked!");
            GetPlayerPos(playerid,X,Y,Z);
            PlayerPlaySound(playerid,1056,X,Y,Z);
        }
        else
        {
            SendClientMessage(playerid, GREY, "You're not in a vehicle!");
        }
      return 1;
    }

  if (strcmp(cmdtext, "/unlock", true)==0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid, GREY,"You can only unlock the doors as the driver.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
            }
            new Float:X,Float:Y,Float:Z;
            SendClientMessage(playerid, GREY, "Vehicle unlocked!");
            GetPlayerPos(playerid,X,Y,Z);
            PlayerPlaySound(playerid,1057,X,Y,Z);
        }
        else
        {
            SendClientMessage(playerid, GREY, "You're not in a vehicle!");
        }
      return 1;
    }

So how can i make script that if somewho want to enter in locked vehicle, that he will play an animation of locked doors?

I tried with this but i dont know what i must to add near vehicleid == !!
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(vehicleid == [color=red]?[/color])
  {
    ApplyAnimation(playerid, "PED", "CAR_doorlocked_LHS [color=red]or[/color] CAR_doorlocked_RHS ", 1, 0, 0, 0, 0, 1);
    SetVehicleParamsForPlayer(vehicleid, playerid, 0, 1);
  }
  return 1;
}

but...

thank you for help
yugokoral is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Help] How can i apply an animation on my npc? evilinside Help Archive 7 01/11/2009 12:09 AM
Lock all cars and use the locked animation Memoryz Help Archive 2 12/09/2009 09:42 PM
[SOLVED] Apply animation problem! Ben147 Help Archive 3 22/08/2009 11:38 AM
Animation wont apply JoeDaDude Help Archive 13 14/06/2009 07:11 PM
[Animation]singing animation klavins21 Help Archive 4 05/03/2009 06:31 PM


All times are GMT. The time now is 01:48 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.