SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 01/01/2010, 06:10 PM   #1
_ERO_
Big Clucker
 
_ERO_'s Avatar
 
Join Date: Aug 2009
Posts: 51
Reputation: 0
Default Why the command /lock dont work?

pawn Code:
if(strcmp(cmd, "/lock", true) == 0)
    {
        new carid = GetPlayerVehicleID(playerid);
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(VehicleLockedPlayer[playerid] != 999)
            {
                SendClientMessage(playerid, COLOR_GREY, "[Error:] You already locked this vehicle or another vehicle");
                return 1;
            }
        if(VehicleLocked[carid] == 0)
            {
            if(PlayerInfo[playerid][pSex] == 1)
            {
                PlayerActionMessage(playerid,15.0,"locked his vehicle");
            }
            else
            {
                PlayerActionMessage(playerid,15.0,"locked her vehicle");
            }
            SendClientMessage(playerid, COLOR_WHITE, "[Info:] Vehicle Locked");
            VehicleLocked[carid] = 1;
            VehicleLockedPlayer[playerid] = carid;
            }
        }
        else if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
            new Float:x,Float:y,Float:z;
            if(VehicleLockedPlayer[playerid] != 999)
            {
                GetVehiclePos(VehicleLockedPlayer[playerid], x, y, z);
            }
            if(VehicleLocked[VehicleLockedPlayer[playerid]])
            {
                if(PlayerToPoint(5.0,playerid,x,y,z) || GetPlayerVehicleID(playerid) == VehicleLockedPlayer[playerid])
              {
                    if(PlayerInfo[playerid][pSex] == 1)
                    {
                        PlayerActionMessage(playerid,15.0,"unlocked his vehicle");
                    }
                    else
                    {
                        PlayerActionMessage(playerid,15.0,"unlocked her vehicle");
                    }
                    SendClientMessage(playerid, COLOR_WHITE, "[Info:] Vehicle Unlocked");
                    VehicleLocked[VehicleLockedPlayer[playerid]] = 0;
                    VehicleLockedPlayer[playerid] = 999;
                }
                else
                {
                  SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not near the vehicle");
                }
            }
        }
        return 1;

Idk where is the error, i just type it, and the vehicle dont get lock
__________________
Hosting Espaņol SA:MP, preguntar en el soporte | http://www.overserver.es/
_ERO_ is offline  
Old 03/01/2010, 06:56 PM   #2
jasonnw666
Huge Clucker
 
Join Date: Apr 2009
Posts: 293
Reputation: 0
Default Re: Why the command /lock dont work?

lock command bug in samp 0.3
use OnVehicleStreamIn
jasonnw666 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 this dont work į_į iJumbo Help Archive 3 21/05/2010 08:23 AM
[HELP] License command dont work FreddeN Help Archive 2 08/02/2010 10:15 PM
SA:MP 0.3a dont work!?!? Currybooi Client Support 5 02/02/2010 02:21 PM
why dont my fight command work? [mad]MLK Help Archive 18 10/09/2009 12:53 PM


All times are GMT. The time now is 02:28 PM.


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