[HELP]OnPlayerCommandText its bug
#1

why my OnPlayerCommandText is bug if im in game i type /sb or /seatbelt wont work its said "Unknown Command" help me please ASAP!!


here the code
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new string[256];
    new cmd[256];
    new tmp[256];
    new giveplayer[MAX_PLAYER_NAME];
    new giveplayerid, idx;
    cmd = strtok(cmdtext, idx);
    new sendername[MAX_PLAYER_NAME];
    if(strcmp(cmd,"/sb",true)==0)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
            SendClientMessage(playerid,COLOR_GREY,"You need to be in a vehicle.");
            return 1;
        }
        if(PlayerInfo[playerid][pSeatBelt] == 1)
        {
            PlayerInfo[playerid][pSeatBelt] = 0;
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new stringtosee[255];
            format(stringtosee, sizeof(stringtosee), "*** %s unbuckles his/her seatbelt.", sendername);
            ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
            return 1;
        }
        PlayerInfo[playerid][pSeatBelt] = 1;
        GetPlayerName(playerid, sendername, sizeof(sendername));
        new stringtosee[255];
        format(stringtosee, sizeof(stringtosee), "*** %s buckles his/her seatbelt.", sendername);
        ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
    }
//Checking seatbelt
    if(strcmp(cmd, "/checksb", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /checksb [playerid]");
            return 1;
        }
        new playa;
        if(strlen(tmp))
        {
            playa = ReturnUser(tmp);
        }
        else
        {
            playa = strval(tmp);
        }
        if(GetPlayerState(playa) == PLAYER_STATE_ONFOOT)
        {
            SendClientMessage(playerid,COLOR_GREY,"Player isn't in a vehicle.");
            return 1;
        }
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(IsAPoliceSkin(playerid))
        {
            giveplayerid = ReturnUser(tmp);
            if(ProxDetectorS(9.0, playerid, giveplayerid))
            {
                new stext[255];
                if(PlayerInfo[playa][pSeatBelt] == 0)
                {
                    stext = "off";
                }
                else if(PlayerInfo[playa][pSeatBelt] == 1)
                {
                    stext = "on";
                }
                format(string, sizeof(string), "%s have the seatbelt %s." , giveplayer , stext);
                SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 6000);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player is not near you!");
            }
        }
        else
        {
            SendClientMessage(playerid,COLOR_GREY,"You're not an Police Officer!");
        }
        return 1;
    }
    return 0;
}
public IsAPoliceSkin(skinid)
{
    if((skinid >= 265 && skinid <= 266) || (skinid == 267) || (skinid == 280) || (skinid == 281) || (skinid == 282) || (skinid == 283) || (skinid == 284) || (skinid == 285) || (skinid == 286) || (skinid == 287) || (skinid == 288))
    {
        return 1;
    }
    return 0;
}
Reply
#2

untested
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    new
        string[ 128 ], tmp[ 256 ], giveplayer[ MAX_PLAYER_NAME ], giveplayerid, idx, sendername[ MAX_PLAYER_NAME ];

    if( strcmp( cmdtext, "/sb", true ) == 0 )
    {
        if( GetPlayerState( playerid ) == PLAYER_STATE_ONFOOT ) return SendClientMessage(playerid,COLOR_GREY,"You need to be in a vehicle.");

        if( PlayerInfo[ playerid ][ pSeatBelt ] == 1 )
        {
            PlayerInfo[ playerid ][ pSeatBelt ] = 0;
            GetPlayerName( playerid, sendername, sizeof( sendername ) );
            format( string, sizeof( string ), "*** %s unbuckles his/her seatbelt.", sendername );
            ProxDetector( 30.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA );
            return 1;
        }
        PlayerInfo[ playerid ][ pSeatBelt ] = 1;
        GetPlayerName( playerid, sendername, sizeof( sendername ) );
        format( string, sizeof( string ), "*** %s buckles his/her seatbelt.", sendername );
        ProxDetector(30.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA );
    }
    //Checking seatbelt
    if( strcmp( cmdtext, "/checksb", true ) == 0 )
    {
        tmp = strtok( cmdtext, idx );
        if( !strlen( tmp ) ) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /checksb [playerid]" );

        new
            playa;
           
        if( strlen( tmp ) ) playa = ReturnUser( tmp );
        else playa = strval( tmp );

        if( GetPlayerState( playa ) == PLAYER_STATE_ONFOOT ) return SendClientMessage(playerid,COLOR_GREY,"Player isn't in a vehicle." );

        GetPlayerName( playa, giveplayer, sizeof( giveplayer ) );
        GetPlayerName( playerid, sendername, sizeof( sendername ) );
        if( !IsAPoliceSkin( playerid ) ) return SendClientMessage( playerid,COLOR_GREY,"You're not an Police Officer!" );

        giveplayerid = ReturnUser( tmp );
        if( ProxDetectorS( 9.0, playerid, giveplayerid ) )
        {
            new
                stext[ 3 ];
                   
            if( PlayerInfo[ playa ][ pSeatBelt ] == 0 )
            {
                stext = "off";
            }
            else
            {
                stext = "on";
            }
            format( string, sizeof( string), "%s have the seatbelt %s." , giveplayer , stext );
            SetPlayerChatBubble( playerid, string, COLOR_PURPLE, 30.0, 6000 );
        }
        else SendClientMessage( playerid, COLOR_GREY, "That player is not near you!" );
        return 1;
    }
    return 0;
}
Reply
#3

Quote:
Originally Posted by Dwane
Посмотреть сообщение
untested
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    new
        string[ 128 ], tmp[ 256 ], giveplayer[ MAX_PLAYER_NAME ], giveplayerid, idx, sendername[ MAX_PLAYER_NAME ];

    if( strcmp( cmdtext, "/sb", true ) == 0 )
    {
        if( GetPlayerState( playerid ) == PLAYER_STATE_ONFOOT ) return SendClientMessage(playerid,COLOR_GREY,"You need to be in a vehicle.");

        if( PlayerInfo[ playerid ][ pSeatBelt ] == 1 )
        {
            PlayerInfo[ playerid ][ pSeatBelt ] = 0;
            GetPlayerName( playerid, sendername, sizeof( sendername ) );
            format( string, sizeof( string ), "*** %s unbuckles his/her seatbelt.", sendername );
            ProxDetector( 30.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA );
            return 1;
        }
        PlayerInfo[ playerid ][ pSeatBelt ] = 1;
        GetPlayerName( playerid, sendername, sizeof( sendername ) );
        format( string, sizeof( string ), "*** %s buckles his/her seatbelt.", sendername );
        ProxDetector(30.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA );
    }
    //Checking seatbelt
    if( strcmp( cmdtext, "/checksb", true ) == 0 )
    {
        tmp = strtok( cmdtext, idx );
        if( !strlen( tmp ) ) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /checksb [playerid]" );

        new
            playa;
           
        if( strlen( tmp ) ) playa = ReturnUser( tmp );
        else playa = strval( tmp );

        if( GetPlayerState( playa ) == PLAYER_STATE_ONFOOT ) return SendClientMessage(playerid,COLOR_GREY,"Player isn't in a vehicle." );

        GetPlayerName( playa, giveplayer, sizeof( giveplayer ) );
        GetPlayerName( playerid, sendername, sizeof( sendername ) );
        if( !IsAPoliceSkin( playerid ) ) return SendClientMessage( playerid,COLOR_GREY,"You're not an Police Officer!" );

        giveplayerid = ReturnUser( tmp );
        if( ProxDetectorS( 9.0, playerid, giveplayerid ) )
        {
            new
                stext[ 3 ];
                   
            if( PlayerInfo[ playa ][ pSeatBelt ] == 0 )
            {
                stext = "off";
            }
            else
            {
                stext = "on";
            }
            format( string, sizeof( string), "%s have the seatbelt %s." , giveplayer , stext );
            SetPlayerChatBubble( playerid, string, COLOR_PURPLE, 30.0, 6000 );
        }
        else SendClientMessage( playerid, COLOR_GREY, "That player is not near you!" );
        return 1;
    }
    return 0;
}
all command i put in my script not working bcuz i got error in my "server_log"

Here: ([13:00:12] Script[gamemodes/Log.amx]: Run time error 20: "Invalid index parameter (bad entry point)")

can you help me to fix this bro?

pawn Код:
[13:00:09]  
[13:00:09]   Loaded.
[13:00:09]  Loading plugin: streamer
[13:00:09]

*** Streamer Plugin v2.5.2 R2 by Incognito loaded ***

[13:00:09]   Loaded.
[13:00:09]  Loaded 3 plugins.

[13:00:09]
[13:00:09] Filterscripts
[13:00:09] ---------------
[13:00:09]   Loading filterscript 'baseaf.amx'...
[13:00:09]
--Base FS loaded.

[13:00:09]   Loading filterscript 'gl_actions.amx'...
[13:00:09]   Loading filterscript 'gl_realtime.amx'...
[13:00:09]   Loading filterscript 'gl_mapicon.amx'...
[13:00:09]   Loading filterscript 'ls_elevator.amx'...
[13:00:09]   Loading filterscript 'mREGV0.8.amx'...
[13:00:09]  
[13:00:09]  =======================================
[13:00:09]  |                                     |
[13:00:09]  |        YSI version 1.03.0011        |
[13:00:09]  |        By Alex "******" Cole        |
[13:00:09]  |                                     |
[13:00:09]  |  Checking the latest YSI version..  |
[13:00:09]  |                                     |
[13:00:09]  =======================================
[13:00:09]  
[13:00:09]   Loading filterscript 'FSpeed.amx'...
[13:00:09]
-----------------------------------------
[13:00:09] Stefan/Kevin974 - Speedometer/Fuel/Engine and Neons system
[13:00:09] -----------------------------------------

[13:00:09]   Loaded 7 filterscripts.

[13:00:10] Incoming connection: 127.0.0.1:64783
[13:00:11] Incoming connection: 127.0.0.1:64784
[13:00:12] Script[gamemodes/Log.amx]: Run time error 20: "Invalid index parameter (bad entry point)"
[13:00:12] Number of vehicle models: 14
[13:00:12] [npc:join] Dave has joined the server (0:127.0.0.1)
[13:00:12] [npc:join] Taxi has joined the server (1:127.0.0.1)
[13:00:12]  
[13:00:12]  ==========================================
[13:00:12]  |                                        |
[13:00:12]  |  A new version (v1.04.0000) of YSI is  |
[13:00:12]  |            available from:             |
[13:00:12]  |                                        |
[13:00:12]  |     [url]www.y-less.com/YSI/YSI_1.0.zip[/url]     |
[13:00:12]  |                                        |
[13:00:12]  | Changelog:                             |
[13:00:12]  |                                        |
[13:00:12]  |   1.04.0000:                           |
[13:00:12]  |                                        |
[13:00:12]  |   RC 1 for YSI 3.0.  Available from:   |
[13:00:12]  | [url]http://www.y-less.com/YSI/YSI_3.0.rar[/url]  |
[13:00:12]  | - includes MANY new libraries and      |
[13:00:12]  | fixes, see                             |
[13:00:12]  | [url]http://forum.sa-mp.com/showthread.php?[/url] |
[13:00:12]  | p=1425938 for more information, with   |
[13:00:12]  | more topics and updates due over the   |
[13:00:12]  | next few weeks.  In brief: Added       |
[13:00:12]  | "y_inline", "y_text", "y_users",       |
[13:00:12]  | "y_uvar", "y_svar", "y_remote";        |
[13:00:12]  | updated "y_timers", "y_iter"; MANY     |
[13:00:12]  | MANY fixes and tweaks in almost every  |
[13:00:12]  | other library.                         |
[13:00:12]  |                                        |
[13:00:12]  ==========================================
[13:00:12]  
[13:00:13] Incoming connection: 127.0.0.1:64785
[13:00:13] [npc:join] Taxii has joined the server (2:127.0.0.1)
Reply
#4

Search please....

http://forum.sa-mp.com/showthread.ph...ndex+parameter
http://forum.sa-mp.com/showthread.ph...ndex+parameter
http://forum.sa-mp.com/showthread.ph...ndex+parameter
Reply
#5

You don't have at your gamemode
pawn Код:
main()
{ }
Don't be lazy, it's not dificult for you to copy it from server_log and paste it on ******.
Don't wait from others search for you!
Reply
#6

The code returns 0....
Reply
#7

thanks


Quote:
Originally Posted by Dwane
Посмотреть сообщение
You don't have at your gamemode
pawn Код:
main()
{ }
Don't be lazy, it's not dificult for you to copy it from server_log and paste it on ******.
Don't wait from others search for you!
thanks too.. but why my all command not working can you help me

here can you help me where the error in my script

pawn Код:
//*===Commands: /rentcar, /unrentcar, /exitrental, /renthelp, /addrental (easy function generator)===*
#include <a_samp>
#include <YSI\y_ini>
#include <zcmd>
#include <utils> //Must have this .inc(lude)

#define TEAM_GROVE_COLOR 0x00D900C8
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_WHITE 0xFFFFFFAA


enum cInfo
{
    cStarted
};
new CarInfo[MAX_VEHICLES][cInfo];

enum pInfo
{
    pSeatBelt
};
new PlayerInfo[MAX_PLAYERS][pInfo];

forward IsAPoliceSkin(skinid);
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
forward ProxDetectorS(Float:radi, playerid, targetid);

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA // - Light light pink
#define COLOR_SEAGREEN 0x2E8B57AA
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_ADMIN 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^

#define COLOR_GREY        0xAFAFAFAA
#define COLOR_GREEN       0x33AA33AA
#define COLOR_BRIGHTRED   0xFF0000AA
#define COLOR_DARKRED     0xC60000FF
#define COLOR_YELLOW      0xFFFF00AA
#define COLOR_TAN         0xBDB76BAA
#define COLOR_PURPLE      0x800080AA
#define COLOR_WHITE       0xFFFFFFAA
#define COLOR_LIGHTBLUE   0x33CCFFAA
#define COLOR_ORANGE      0xFF9900AA
#define COLOR_INDIGO      0x4B00B0AA
#define COLOR_SYSTEM      0xa9c4e4
#define COLOR_SANTORANGE  0xFF6C3BAA
#define COLOR_INVIS       0xAFAFAF00
#define COLOR_CRIMBLUE    0x3A47DEFF
#define COLOR_WANTED      0xCC0066AA
#define COLOR_GROVE       0x378729FF
#define COLOR_BALLAS      0xA31D88FF
#define COLOR_DARKGREY    0x696969FF
#define COLOR_ERPSS       0x549852FF
#define COLOR_L1A         0x50A2ABFF
#define COLOR_FADE1       0xE6E6E6E6
#define COLOR_FADE2       0xC8C8C8C8
#define COLOR_FADE3       0xAAAAAAAA
#define COLOR_FADE4       0x8C8C8C8C
#define COLOR_FADE5       0x6E6E6E6E
#define BLACK             0x000000FF

#define      RENT_COST       300  // Change for car rent cost

new IsRentable[MAX_VEHICLES];
new IsRented[MAX_VEHICLES];
new RentedBy[MAX_VEHICLES][24];



new MyFirstNPCVehicle;
new AnotherNPCVehicleID;

main()
{}

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("PHP-RP*New 0.2v Test ");
    AddPlayerClass(299,1640.1290,-2332.6826,13.5469,359.3599,0,0,0,0,0,0);//Cloud
    AddStaticVehicle(420,1792.5182,-1868.8519,13.3470,358.9712,6,1); //
    AddStaticVehicle(560,1636.7418,-2324.6045,13.1665,267.9057,9,39); // pos spawn

    // AirPort LS Planes & Vehicles Around
    AddStaticVehicle(592,1628.8137,-2445.3936,14.7748,0.0000,1,1); //
    AddStaticVehicle(563,1764.6505,-2284.8621,27.6965,335.9916,1,6); //
    AddStaticVehicle(589,1646.4996,-2323.3301,13.0866,267.8579,31,31); //

    CreateObject(1683, 1901.9000244141, -2392.8000488281, 18.5, 0, 0, 182);
    CreateObject(1683, 1725.1999511719, -2442, 18.5, 0, 0, 90);
    CreateObject(1683, 1560.8000488281, -2451.3000488281, 18.5, 0, 0, 90);
    CreateObject(1683, -1356.0999755859, -208.89999389648, 23.39999961853, 0, 0, 232);
    CreateObject(1683, -1314.8000488281, -249.39999389648, 19.10000038147, 0, 0, 217.99830627441);
    CreateObject(1683, -1481, -172.5, 19.10000038147, 0, 0, 269.99996948242);
    CreateObject(1683, -1282.9000244141, -361.20001220703, 19.10000038147, 0, 0, 188);
    CreateObject(1683, -1363.5999755859, -489.5, 19.10000038147, 0, 0, 298);

    //"Bar Object"
    CreateObject(8041, 2271.8000488281, -1719.9000244141, 12.699999809265, 0, 0, 270);
    CreateObject(3037, 2272.8999023438, -1721.5999755859, 14.39999961853, 0, 0, 90);
    CreateObject(982, 1201.5999755859, -1372.4000244141, 13, 0, 0, 0);
    CreateObject(982, 1200.4000244141, -1372.4000244141, 13, 0, 0, 0);
    CreateObject(982, 1201.5999755859, -1346.8000488281, 13.10000038147, 0, 0, 0);
    CreateObject(982, 1200.4000244141, -1346.8000488281, 13.10000038147, 0, 0, 0);
    CreateObject(984, 1201.5999755859, -1327.5999755859, 13, 0, 0, 0);
    CreateObject(984, 1200.4000244141, -1327.5999755859, 13, 0, 0, 0);
    CreateObject(1238, 1206.0999755859, -1326, 12.699999809265, 0, 0, 0);
    CreateObject(1238, 1206.0999755859, -1323.9000244141, 12.699999809265, 0, 0, 0);
    CreateObject(1238, 1206.0999755859, -1321.8000488281, 12.699999809265, 0, 0, 0);
    CreateObject(1238, 1206.0999755859, -1319.9000244141, 12.699999809265, 0, 0, 0);
    CreateObject(1238, 1206.0999755859, -1318.0999755859, 12.699999809265, 0, 0, 0);
    CreateObject(1238, 1206.0999755859, -1316, 12.699999809265, 0, 0, 0);
    CreateObject(1238, 1206.0999755859, -1314.1999511719, 12.699999809265, 0, 0, 0);
    CreateObject(1238, 1206, -1312.3000488281, 12.699999809265, 0, 0, 0);
    CreateObject(1422, 1203.5, -1312.1999511719, 12.800000190735, 0, 0, 0);
    CreateObject(1422, 1198.4000244141, -1312.1999511719, 12.800000190735, 0, 0, 0);
    CreateObject(983, 1201.5999755859, -1308.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(983, 1201.5999755859, -1302, 13.10000038147, 0, 0, 0);
    CreateObject(983, 1201.5999755859, -1295.5999755859, 13.10000038147, 0, 0, 0);
    CreateObject(983, 1201.5999755859, -1294, 13.10000038147, 0, 0, 0);
    CreateObject(983, 1200.5, -1294, 13.10000038147, 0, 0, 0);
    CreateObject(983, 1200.5, -1295.5999755859, 13.10000038147, 0, 0, 0);
    CreateObject(983, 1200.5, -1302, 13.10000038147, 0, 0, 0);
    CreateObject(983, 1200.5, -1308.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1201, -1384.9000244141, 12.800000190735, 0, 0, 0);
    CreateObject(1215, 1201, -1376.1999511719, 12.800000190735, 0, 0, 0);
    CreateObject(1215, 1200.9000244141, -1368.3000488281, 12.89999961853, 0, 0, 0);
    CreateObject(1215, 1200.9000244141, -1360.3000488281, 12.89999961853, 0, 0, 0);
    CreateObject(1215, 1200.9000244141, -1352.4000244141, 13, 0, 0, 0);
    CreateObject(1215, 1200.9000244141, -1344.4000244141, 13, 0, 0, 0);
    CreateObject(1215, 1201, -1336.4000244141, 13, 0, 0, 0);
    CreateObject(1215, 1201, -1328.4000244141, 13, 0, 0, 0);
    CreateObject(1215, 1201, -1321.3000488281, 13, 0, 0, 0);
    CreateObject(1215, 1201, -1311.6999511719, 13, 0, 0, 0);
    CreateObject(1215, 1201, -1299.0999755859, 12.89999961853, 0, 0, 0);
    CreateObject(1215, 1201, -1290.9000244141, 12.89999961853, 0, 0, 0);
    CreateObject(1215, 1201, -1306.0999755859, 13, 0, 0, 0);
    CreateObject(1352, 1205.1999511719, -1312.1999511719, 12.39999961853, 0, 0, 0);
    CreateObject(3263, 1205.1999511719, -1312.0999755859, 12.39999961853, 0, 0, 0);
    CreateObject(1257, 1189.0999755859, -1373.0999755859, 13.800000190735, 0, 0, 180);
    CreateObject(1229, 1190, -1366.8000488281, 14.10000038147, 0, 0, 180);
    CreateObject(970, 1195.3000488281, -1365.8000488281, 12.89999961853, 0, 0, 90);
    CreateObject(970, 1195.3000488281, -1369.9000244141, 12.89999961853, 0, 0, 90);
    CreateObject(970, 1195.3000488281, -1374, 12.89999961853, 0, 0, 90);
    CreateObject(970, 1195.3000488281, -1378.0999755859, 12.89999961853, 0, 0, 90);
    CreateObject(3526, 1189.1999511719, -1370.0999755859, 12.60000038147, 0, 0, 90);
    CreateObject(3526, 1174.9000244141, -1356.5999755859, 13.10000038147, 0, 0, 0);
    CreateObject(3526, 1175, -1366, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1172.5, -1364.5, 13.5, 0, 0, 0);
    CreateObject(1215, 1172.3000488281, -1358.5999755859, 13.5, 0, 0, 0);

    //"Gb- Object"
    CreateObject(997, 2235.7998046875, -1727.19921875, 12.5, 0, 0, 0);
    CreateObject(997, 2233.3999023438, -1727.1999511719, 12.5, 0, 0, 0);
    CreateObject(997, 2231.1000976563, -1727.1999511719, 12.5, 0, 0, 0);
    CreateObject(997, 2228.8000488281, -1727.1999511719, 12.5, 0, 0, 0);
    CreateObject(997, 2226.5, -1727.1999511719, 12.5, 0, 0, 0);
    CreateObject(997, 2224.1000976563, -1726.5999755859, 12.39999961853, 0, 0, 348);
    CreateObject(997, 2222.3000488281, -1725, 12.5, 0, 0, 321.99743652344);
    CreateObject(997, 2221.5, -1723, 12.60000038147, 0, 0, 299.99279785156);
    CreateObject(997, 2221.6000976563, -1721.0999755859, 12.5, 0, 0, 273.99267578125);
    CreateObject(997, 2221.8000488281, -1718.3000488281, 12.5, 0, 0, 265.98803710938);
    CreateObject(997, 2222, -1716, 12.5, 0, 0, 265.98449707031);
    CreateObject(997, 2223.1999511719, -1713.6999511719, 12.5, 0, 0, 0);
    CreateObject(997, 2222.3999023438, -1713.6999511719, 12.5, 0, 0, 263.98449707031);
    CreateObject(997, 2238.1999511719, -1727.4000244141, 12.800000190735, 0, 0, 0);
    CreateObject(997, 2241.5, -1727.5999755859, 13, 0, 0, 90);
    CreateObject(1698, 2243.6999511719, -1732.3000488281, 12.5, 0, 0, 0);
    CreateObject(1698, 2243.6999511719, -1735.5999755859, 12.5, 0, 0, 0);
    CreateObject(1698, 2243.6999511719, -1729, 12.5, 0, 0, 0);
    CreateObject(8841, 2271.8999023438, -1709.5999755859, 19.89999961853, 0, 0, 0);
    CreateObject(1676, 1941.8000488281, -1769.3000488281, 14.139999389648, 0, 0, 270);
    CreateObject(1676, 1941.8000488281, -1776.3790283203, 14.129999160767, 0, 0, 270);
    CreateObject(970, 1942.5, -1778.9000244141, 12.89999961853, 0, 0, 90);
    CreateObject(970, 1942.5, -1774.8000488281, 12.89999961853, 0, 0, 90);
    CreateObject(970, 1942.5, -1770.6999511719, 12.89999961853, 0, 0, 90);
    CreateObject(970, 1942.5, -1766.5999755859, 12.89999961853, 0, 0, 90);
    CreateObject(970, 1940.8000488281, -1766.6999511719, 12.89999961853, 0, 0, 90);
    CreateObject(970, 1940.8000488281, -1770.8000488281, 12.89999961853, 0, 0, 90);
    CreateObject(970, 1940.8000488281, -1774.9000244141, 12.89999961853, 0, 0, 90);
    CreateObject(970, 1940.8000488281, -1779, 12.89999961853, 0, 0, 90);
    CreateObject(1215, 1941.5999755859, -1780.9000244141, 13.199999809265, 0, 0, 0);
    CreateObject(1215, 1941.5999755859, -1764.8000488281, 13.199999809265, 0, 0, 0);
    CreateObject(982, 1506.8000488281, -1727.1999511719, 13.199999809265, 0, 0, 90);
    CreateObject(982, 1481.1999511719, -1727.1999511719, 13.199999809265, 0, 0, 90);
    CreateObject(982, 1455.5999755859, -1727.1999511719, 13.199999809265, 0, 0, 90);
    CreateObject(982, 1452.4000244141, -1727.1999511719, 13.199999809265, 0, 0, 90);
    CreateObject(982, 1411.3000488281, -1737.5, 13.199999809265, 0, 0, 90);
    CreateObject(982, 1436.9000244141, -1737.5, 13.199999809265, 0, 0, 90);
    CreateObject(982, 1462.5, -1737.5, 13.199999809265, 0, 0, 90);
    CreateObject(982, 1500.6999511719, -1737.5, 13.199999809265, 0, 0, 90);
    CreateObject(982, 1526.3000488281, -1737.5, 13.199999809265, 0, 0, 90);
    CreateObject(982, 1547.0999755859, -1737.5, 13.199999809265, 0, 0, 90);
    CreateObject(1215, 1559.5999755859, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1551.0999755859, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1543.0999755859, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1535.0999755859, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1527, -1737.5999755859, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1519.0999755859, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1511.0999755859, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1503.0999755859, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1495.0999755859, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1488, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1475.1999511719, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1466.5, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1458.5, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1450.5, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1442.5, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1434.5, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1426.5, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1418.5999755859, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1410.5, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1402.6999511719, -1737.5999755859, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1398.5999755859, -1737.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1439.6999511719, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1448.4000244141, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1456.4000244141, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1464.5, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1472.4000244141, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1480.4000244141, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1488.5, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1496.4000244141, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1504.4000244141, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1512.4000244141, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1519.5, -1727, 13.10000038147, 0, 0, 0);
    CreateObject(9833, 1478.5, -1639.5999755859, 16.39999961853, 0, 0, 0);
    CreateObject(994, 1137.1999511719, -1416.0999755859, 12.60000038147, 0, 0, 0);
    CreateObject(994, 1129.5999755859, -1416, 12.60000038147, 0, 0, 0);
    CreateObject(994, 1121.9000244141, -1416, 12.60000038147, 0, 0, 0);
    CreateObject(994, 1114.0999755859, -1416, 12.60000038147, 0, 0, 0);

    //"PDgate Object"
    CreateObject(982, 1524.5, -1709.4000244141, 13.199999809265, 0, 0, 0);
    CreateObject(982, 1524.5, -1683.8000488281, 13.199999809265, 0, 0, 0);
    CreateObject(982, 1524.5, -1658.1999511719, 13.199999809265, 0, 0, 0);
    CreateObject(982, 1524.5, -1632.5999755859, 13.199999809265, 0, 0, 0);
    CreateObject(982, 1524.5, -1615, 13.199999809265, 0, 0, 0);
    CreateObject(984, 1534.6999511719, -1608.5999755859, 13.199999809265, 0, 0, 0);
    CreateObject(984, 1534.6999511719, -1611.8000488281, 13.199999809265, 0, 0, 0);
    CreateObject(982, 1534.8000488281, -1650.6999511719, 13.199999809265, 0, 0, 0);
    CreateObject(982, 1534.6999511719, -1694.6999511719, 13.199999809265, 0, 0, 0);
    CreateObject(982, 1534.6999511719, -1709.0999755859, 13.199999809265, 0, 0, 0);
    CreateObject(997, 1534.5999755859, -1663.6999511719, 12.5, 0, 0, 0);
    CreateObject(997, 1534.5999755859, -1681.6999511719, 12.5, 0, 0, 0);
    CreateObject(994, 1537.5999755859, -1670.4000244141, 12.5, 0, 0, 90);
    CreateObject(994, 1537.5999755859, -1681.4000244141, 12.5, 0, 0, 90);
    CreateObject(997, 1537.5999755859, -1674.4000244141, 12.5, 0, 0, 90);
    CreateObject(1215, 1524.3000488281, -1602.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1534.9000244141, -1602.3000488281, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1534.9000244141, -1609.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1609.5, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1617.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1534.9000244141, -1617.5, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1625.5, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1633.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1535, -1638.0999755859, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1641.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1649.5, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1657.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1665.3000488281, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1673.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1681.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1689.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1697.5, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1705.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1713.5, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1524.3000488281, -1721.5999755859, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1535, -1646.8000488281, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1535, -1654.8000488281, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1535, -1663.4000244141, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1537.6999511719, -1664, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1537.8000488281, -1672.8000488281, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1537.8000488281, -1681.5, 13.199999809265, 0, 0, 0);
    CreateObject(1215, 1534.9000244141, -1682, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1534.9000244141, -1690.8000488281, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1534.9000244141, -1698.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1534.9000244141, -1706.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1534.9000244141, -1714.6999511719, 13.10000038147, 0, 0, 0);
    CreateObject(1215, 1534.9000244141, -1721.6999511719, 13.10000038147, 0, 0, 0);

    // Vehicle
    AddStaticVehicle(420,1792.5182,-1868.8519,13.3470,358.9712,6,1); //
    AddStaticVehicle(420,1797.3666,-1869.1920,13.3464,0.6133,6,1); //
    AddStaticVehicle(420,1802.6237,-1869.3936,13.3578,0.2108,6,1); //
    AddStaticVehicle(420,1807.5787,-1869.4045,13.3613,0.1434,6,1); //
    AddStaticVehicle(596,1535.6187,-1677.3275,13.1032,0.0661,0,1); //
    AddStaticVehicle(596,1535.5948,-1667.7310,13.1025,179.6110,0,1); //
    AddStaticVehicle(523,1584.1926,-1680.8900,5.4637,91.5172,0,0); // bike lspd
    AddStaticVehicle(523,1584.3688,-1678.9926,5.4631,88.2777,0,0); // bike lspd
    AddStaticVehicle(523,1584.5598,-1676.2649,5.4659,88.8802,0,0); // bike lspd
    AddStaticVehicle(523,1599.5247,-1711.5624,5.4568,193.3797,0,0); // bike lspd
    AddStaticVehicle(523,1603.1367,-1708.8385,5.4613,249.8300,0,0); // bike lspd
    AddStaticVehicle(427,1544.7518,-1663.7491,6.0229,89.4716,0,1); // police truck
    AddStaticVehicle(427,1544.5417,-1672.1401,6.0226,91.0030,0,1); // police truck
    AddStaticVehicle(427,1544.0696,-1655.0531,6.0225,89.1236,0,1); //
    AddStaticVehicle(528,1543.5304,-1658.8114,5.9341,89.6292,0,0); // mini tank
    AddStaticVehicle(528,1544.6726,-1667.7328,5.9333,88.8114,0,0); // mini tank
    AddStaticVehicle(528,1545.1516,-1650.7355,5.9362,89.8955,0,0); // mini tank
    AddStaticVehicle(601,1531.1046,-1645.1536,5.6493,180.7363,1,1); // police tank
    AddStaticVehicle(601,1534.5789,-1645.1844,5.6494,180.0924,1,1); // police tank
    AddStaticVehicle(596,1582.7880,-1709.9769,5.6106,0.2301,0,1); // lspd car
    AddStaticVehicle(596,1574.3766,-1709.2836,5.6120,358.8148,0,1); // lspd car
    AddStaticVehicle(596,1530.2350,-1687.3766,5.6122,271.2466,0,1); // lspd car
    AddStaticVehicle(596,1530.1177,-1683.1234,5.6114,269.5537,0,1); // lspd car
    AddStaticVehicle(523,1557.8798,-1693.3101,5.4670,357.6743,0,0); // lspd motor
    AddStaticVehicle(523,1559.1293,-1693.2780,5.4657,0.3357,0,0); // lspd motor
    AddStaticVehicle(523,1560.2535,-1693.3239,5.4611,0.0240,0,0); // lspd motor
    AddStaticVehicle(523,1561.3877,-1693.3300,5.4602,2.5065,0,0); // lspd motor
    AddStaticVehicle(523,1562.6880,-1693.3036,5.4644,359.3146,0,0); // lspd motor
    AddStaticVehicle(596,1578.2202,-1709.5168,5.6109,0.8880,0,1); // lspd car
    AddStaticVehicle(596,1591.6832,-1710.1853,5.6124,358.1938,0,1); // lspd car
    AddStaticVehicle(596,1587.4529,-1710.1191,5.6125,1.5063,0,1); // lspd car
    AddStaticVehicle(596,1601.2946,-1699.5138,5.6118,91.4480,0,1); // lspd car
    AddStaticVehicle(596,1600.6176,-1688.2172,5.6100,90.6386,0,1); // lspd car
    AddStaticVehicle(416,1179.3179,-1338.6058,13.9706,269.7293,1,3); // abulance
    AddStaticVehicle(416,1177.9707,-1308.7695,13.9945,267.7860,1,3); // abulance
    AddStaticVehicle(431,1759.2561,-1850.1907,13.5928,270.5710,75,59); // bus
    AddStaticVehicle(437,1772.0287,-1850.1306,13.6263,270.2001,79,7); // bus
    AddStaticVehicle(437,1804.1565,-1929.3124,13.5213,358.9172,87,7); // bus
    AddStaticVehicle(431,1775.5471,-1929.8420,13.4879,359.3918,92,72); // bus
    AddStaticVehicle(437,1798.9095,-1928.9243,13.5222,353.5769,95,16); // bus
    AddStaticVehicle(437,1793.8398,-1928.6548,13.5217,354.7454,98,20); // bus
    AddStaticVehicle(431,1781.9514,-1929.1381,13.4947,359.3288,47,74); // bus
    AddStaticVehicle(431,1788.0077,-1929.2280,13.4916,358.4221,55,83); // bus
   
    //"Air Object"
    CreateObject(3380, 1201, -1311.4000244141, 12.39999961853, 0, 0, 0);
    CreateObject(980, -1545.9000244141, -430.29998779297, 7.3000001907349, 0, 0, 134);
    CreateObject(1422, -1434, -308.89999389648, 5.4000000953674, 0, 0, 20);
    CreateObject(1434, -1436.3000488281, -309.70001220703, 5, 0, 0, 16);
    CreateObject(8556, -1730, -579.90002441406, 19.89999961853, 0, 0, 90);
    CreateObject(987, -1736.3000488281, -553.70001220703, 13.10000038147, 0, 0, 270);
    CreateObject(3475, -1736.0999755859, -565.40002441406, 15.5, 0, 0, 357.99499511719);
    CreateObject(987, -1724.3000488281, -599.09997558594, 13.5, 0, 0, 177.99450683594);
    CreateObject(3475, -1735.5999755859, -595.29998779297, 16.299999237061, 0, 0, 357.99499511719);
    CreateObject(966, -1725.3994140625, -581.599609375, 15.300000190735, 0, 0, 90);
    CreateObject(968, -1725.4000244141, -581.5, 16.10000038147, 0, 38, 271.99963378906);
    CreateObject(966, -1734.4000244141, -578.29998779297, 15.300000190735, 0, 0, 270);
    CreateObject(968, -1734.4000244141, -578.40002441406, 16.10000038147, 0, 37.996215820313, 90);
    CreateObject(988, -1222.8000488281, 53.900001525879, 14.199999809265, 0, 0, 222);
    CreateObject(988, -1218.0999755859, 68.900001525879, 14.159000396729, 0, 0, 44);
    CreateObject(3578, -1768.0999755859, -566.59997558594, 15.5, 0, 0, 0);
    CreateObject(3578, -1756.0999755859, -566.59997558594, 15.5, 0, 0, 0);
    CreateObject(3578, -1744, -566.59997558594, 15.5, 0, 0, 0);
    CreateObject(3578, -1745.0999755859, -701, 27.39999961853, 354.17886352539, 345.92593383789, 288.54345703125);
    CreateObject(3578, -1748.3000488281, -688.70001220703, 24.700000762939, 358.04373168945, 347.99081420898, 283.57904052734);
    CreateObject(3578, -1750, -675.70001220703, 22.5, 0, 351.99694824219, 273.99060058594);
    CreateObject(3578, -1750, -661.5, 20.700000762939, 0, 351.99645996094, 267.98803710938);
    CreateObject(3578, -1749.4000244141, -647.29998779297, 18.799999237061, 0, 351.99096679688, 267.98400878906);
    CreateObject(3578, -1748.9000244141, -632.70001220703, 17.200000762939, 0, 355.99096679688, 267.98400878906);
    CreateObject(3578, -1748.8000488281, -618.09997558594, 16.200000762939, 3.9902038574219, 355.98022460938, 272.26419067383);
    CreateObject(3578, -1750, -603.09997558594, 15.60000038147, 4, 359.98446655273, 277.98413085938);
    CreateObject(1237, -1717.9000244141, -732.90002441406, 34.799999237061, 0, 0, 0);
    CreateObject(1237, -1716.8000488281, -731.5, 34.799999237061, 0, 0, 0);
    CreateObject(997, -1750.9000244141, -730.29998779297, 30.60000038147, 0, 352, 316);
    CreateObject(997, -1748.3000488281, -732.79998779297, 31.10000038147, 0, 351.99645996094, 317.99975585938);
    CreateObject(997, -1745.5, -735.29998779297, 31.60000038147, 0, 351.99096679688, 317.99926757813);
    CreateObject(997, -1742.5999755859, -737.90002441406, 32.099998474121, 0, 351.99096679688, 317.99926757813);
    CreateObject(3578, -1762.5, -707.59997558594, 27.299999237061, 0, 351.99792480469, 295.9951171875);
    CreateObject(3578, -1767.0999755859, -695.09997558594, 25.299999237061, 0, 351.99645996094, 283.9931640625);
    CreateObject(3578, -1769.1999511719, -681.79998779297, 23.39999961853, 0, 351.99096679688, 273.99108886719);
    CreateObject(3578, -1769.4000244141, -666.79998779297, 21.299999237061, 0, 351.99096679688, 267.98803710938);
    CreateObject(3578, -1768.9000244141, -652.90002441406, 19.5, 0, 353.99096679688, 267.98400878906);
    CreateObject(3578, -1768.5999755859, -638.79998779297, 17.89999961853, 0, 353.99047851563, 269.98400878906);
    CreateObject(3578, -1768.9000244141, -624.59997558594, 16.799999237061, 358.00494384766, 355.98254394531, 271.84338378906);
    CreateObject(3578, -1769.3000488281, -609.40002441406, 15.800000190735, 357.9967956543, 357.98022460938, 269.91009521484);
    CreateObject(2920, 1544.6999511719, -1630.8000488281, 13, 330, 0, 0);
    CreateObject(2933, 1545.1999511719, -1636.9000244141, 14.300000190735, 0, 0, 269);
    CreateObject(2933, 1544.8000488281, -1619.4000244141, 14.199999809265, 0, 0, 268.99475097656);
   
    CreateRentalVehicle(522, -1417.6655, -299.5604, 13.7134, 82.5812, 1, 0); // rental NGR -500

    ConnectNPC("Dave","npc_walk");
   
    //taxi NPC
    ConnectNPC("Taxi Driver1","npc_taxi");
    MyFirstNPCVehicle = CreateVehicle(420, 0.0, 0.0, 5.0, 0.0, 1, 1, 5000);
    //taxi 1 NPC
    ConnectNPC("Taxii","npc_fly");
    AnotherNPCVehicleID = CreateVehicle(420, 0.0, 0.0, 5.0, 0.0, 1, 1, 5000);
   
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
     SetPlayerPos(playerid, -1422.7511,-287.8990,14.1484);
     SetPlayerCameraPos(playerid, -2033.9584,-749.2495,58.7301);
     SetPlayerCameraLookAt(playerid, 1714.4380,-2288.8210,39.5440);
     return 1;
}

public OnPlayerConnect(playerid)
{
    //StartTime[playerid] = 0;

    SetPVarInt(playerid, "Renting", 0);
    SetPVarInt(playerid, "CarRentID", 0);

    SendClientMessage(playerid, COLOR_GREEN, "Wellcome To Noy Ninoy Aquino International Airport!");
    SendClientMessage(playerid, COLOR_RED, "This server is (hard RP) Dont DM, MG and PG or else (Kick/Banned)");
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    if (GetPVarInt(playerid, "Renting") == 1)
        IsRented[GetPVarInt(playerid, "CarRentID")] = 0,
        SetVehicleToRespawn(GetPVarInt(playerid, "CarRentID"));
    DeletePVar(playerid, "Renting");
    DeletePVar(playerid, "CarRentID");
    if(IsPlayerNPC(playerid)) return 1;
    return 1;
}

public OnPlayerSpawn(playerid)
{
   if(IsPlayerNPC(playerid))
   {
     new npcname[MAX_PLAYER_NAME];
     GetPlayerName(playerid, npcname, sizeof(npcname));
     if(!strcmp(npcname, "Taxi", true, 4))
     {
       PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0);
       SetPlayerSkin(playerid, 289);
       return 1;
     }
     if(!strcmp(npcname, "Taxii", true, 5))
     {
       PutPlayerInVehicle(playerid, AnotherNPCVehicleID, 0);
       SetPlayerSkin(playerid, 6);
       return 1;
     }
     return 1;
   }
   // normal players
   return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[playerid][pSeatBelt] = 0;
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new string[256];
    new cmd[256];
    new tmp[256];
    new giveplayer[MAX_PLAYER_NAME];
    new giveplayerid, idx;
    cmd = strtok(cmdtext, idx);
    new sendername[MAX_PLAYER_NAME];
    if(strcmp(cmd,"/sb",true,2)==0)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
            SendClientMessage(playerid,COLOR_GREY,"You need to be in a vehicle.");
            return 1;
        }
        if(PlayerInfo[playerid][pSeatBelt] == 1)
        {
            PlayerInfo[playerid][pSeatBelt] = 0;
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new stringtosee[255];
            format(stringtosee, sizeof(stringtosee), "*** %s unbuckles his/her seatbelt.", sendername);
            ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
            return 1;
        }
        PlayerInfo[playerid][pSeatBelt] = 1;
        GetPlayerName(playerid, sendername, sizeof(sendername));
        new stringtosee[255];
        format(stringtosee, sizeof(stringtosee), "*** %s buckles his/her seatbelt.", sendername);
        ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
    }
//Checking seatbelt
    if(strcmp(cmd, "/checksb", true, 7) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /checksb [playerid]");
            return 1;
        }
        new playa;
        if(strlen(tmp))
        {
            playa = ReturnUser(tmp);
        }
        else
        {
            playa = strval(tmp);
        }
        if(GetPlayerState(playa) == PLAYER_STATE_ONFOOT)
        {
            SendClientMessage(playerid,COLOR_GREY,"Player isn't in a vehicle.");
            return 1;
        }
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(IsAPoliceSkin(playerid))
        {
            giveplayerid = ReturnUser(tmp);
            if(ProxDetectorS(9.0, playerid, giveplayerid))
            {
                new stext[255];
                if(PlayerInfo[playa][pSeatBelt] == 0)
                {
                    stext = "off";
                }
                else if(PlayerInfo[playa][pSeatBelt] == 1)
                {
                    stext = "on";
                }
                format(string, sizeof(string), "%s have the seatbelt %s." , giveplayer , stext);
                SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 6000);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "That player is not near you!");
            }
        }
        else
        {
            SendClientMessage(playerid,COLOR_GREY,"You're not an Police Officer!");
        }
        return 1;
    }
   
    if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
    {
        if(!cmdtext[3])return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        SendClientMessageToAll(COLOR_PINK, str);
        return 1;
    }
    return 0;
}
public IsAPoliceSkin(skinid)
{
    if((skinid >= 265 && skinid <= 266) || (skinid == 267) || (skinid == 280) || (skinid == 281) || (skinid == 282) || (skinid == 283) || (skinid == 284) || (skinid == 285) || (skinid == 286) || (skinid == 287) || (skinid == 288))
    {
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(PlayerInfo[playerid][pSeatBelt] == 1)
    {
        PlayerInfo[playerid][pSeatBelt] = 0;
        new stringtosee[255];
        new sendername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(stringtosee, sizeof(stringtosee), "*** %s unbuckles his/her seatbelt fastly.", sendername);
        ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
        return 1;
    }
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == 2)
    {
        if (oldstate == 1)
        {
            new
                vID = GetPlayerVehicleID(playerid);
            if (IsRentableCar(vID))
            {
                if (!IsRentedCar(vID))
                {
                    new
                        String[128];
                    format(String, 128, "~p~~n~rent cost: ~b~%d~n~~w~type ~b~/rentcar~n~~w~to exit it type~n~~p~/exitrental", RENT_COST);
                    GameTextForPlayer(playerid, String, 30000, 4);
                    SendClientMessage(playerid, -1, "Type {3399CC}/exitrental{FFFFFF} to exit this rental car.");
                    TogglePlayerControllable(playerid, 0);
                }
                else if (IsRentedCar(vID))
                {
                    if (GetPVarInt(playerid, "CarRentID") == vID)
                    {
                        return SendClientMessage(playerid, -1, "{3399CC}Welcome{FFFFFF} to your rented car.");
                    }
                    else if (GetPVarInt(playerid, "CarRentID") != vID)
                    {
                        new
                            String[128];
                        format(String, 128, "This vehicle is rented by: {3399CC}%s{FFFFFF}", RentedBy[vID]);
                        SendClientMessage(playerid, -1, String);
                        SendClientMessage(playerid, -1, "Use {3399CC}/exitrental{FFFFFF} to exit this vehicle.");
                        return 1;
                    }
                }
            }
        }
    }
   
    if(newstate == PLAYER_STATE_DRIVER)
        {
        new vehicle = GetPlayerVehicleID(playerid);
        if(CarInfo[vehicle][cStarted] == 0)
        {
            TogglePlayerControllable(playerid,0);
        }
        else if(CarInfo[vehicle][cStarted] > 0)
        {
            SendClientMessage(playerid,TEAM_GROVE_COLOR,"This vehicle is already started!");
        }
        return 1;
    }
    return 0;
}
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        //radi = 2.0; //Trigger Radius
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
                if (GetPlayerVirtualWorld(playerid)==GetPlayerVirtualWorld(i))
                {
                    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                    {
                        SendClientMessage(i, col1, string);
                    }
                    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                    {
                        SendClientMessage(i, col2, string);
                    }
                    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                    {
                        SendClientMessage(i, col3, string);
                    }
                    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                    {
                        SendClientMessage(i, col4, string);
                    }
                    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    {
                        SendClientMessage(i, col5, string);
                    }
                }
            }
            else
            {
                SendClientMessage(i, col1, string);
            }
        }
    }
    return 1;
}
public ProxDetectorS(Float:radi, playerid, targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        //radi = 2.0; //Trigger Radius
        GetPlayerPos(targetid, posx, posy, posz);
        tempposx = (oldposx -posx);
        tempposy = (oldposy -posy);
        tempposz = (oldposz -posz);
        //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
        if (GetPlayerVirtualWorld(playerid)==GetPlayerVirtualWorld(targetid))
        {
            if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
            {
                return 1;
            }
        }
    }
    return 0;
}
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}

CMD:renthelp(playerid, params[])
{
    SendClientMessage(playerid, -1, "{3399CC}Rent Commands:{FFFFFF} /rentcar, /unrentcar, /exitrental");
    return 1;
}

CMD:addrental(playerid, params[])
{
    new iVeh, iModel, Float:X, Float:Y, Float:Z, Float:Angle, szString[128];
    if (!IsPlayerAdmin(playerid) && !IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, -1, "{3399CC}System:{FFFFFF} You are not an admin / not in any car");

    iVeh = GetPlayerVehicleID(playerid);
    iModel = GetVehicleModel(iVeh);
    GetVehiclePos(iVeh, X, Y, Z);
    GetVehicleZAngle(iVeh, Angle);

    format(szString, 128, "CreateRentalVehicle(%d, %f, %f, %f, %f, %d, %d);", iModel, X, Y, Z, Angle, -1, -1);
    printf(szString);
    SendClientMessage(playerid, -1, szString);
    return 1;
}

CMD:exitrental(playerid, params[])
{
    new
        vID = GetPlayerVehicleID(playerid);
    if (!vID)
    {
        SendClientMessage(playerid, -1, "You are {3399CC}not{FFFFFF} in a rental car!");
        return 1;
    }
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid, 1);
    GameTextForPlayer(playerid, " ", 500, 4);
    return 1;
}

CMD:unrentcar(playerid, params[])
{
    GameTextForPlayer(playerid, " ", 500, 4);
    if (GetPVarInt(playerid, "Renting") == 0)
    {
        SendClientMessage(playerid, -1, "You {3399CC}don't{FFFFFF} even rent a car!");
        return 1;
    }
    new
        vID = GetPVarInt(playerid, "CarRentID");
    IsRented[vID] = 0;
    SetPVarInt(playerid, "CarRentID", 0);
    SetPVarInt(playerid, "Renting", 0);
    new
        Float:X,
        Float:Y,
        Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid, X, Y, Z+1);
    TogglePlayerControllable(playerid, 1);
    SetVehicleToRespawn(vID);
    RentedBy[vID] = "No-one";
    return 1;
}

CMD:rentcar(playerid, params[])
{
    GameTextForPlayer(playerid, " ", 500, 4);
    new
        vID = GetPlayerVehicleID(playerid);
    if (!vID)
    {
        SendClientMessage(playerid, -1, "You are {3399CC}not{FFFFFF} in any car!");
        return 1;
    }
    if (!IsRentableCar(vID))
    {
        SendClientMessage(playerid, -1, "This car is {3399CC}not{FFFFFF} rentable!");
        return 1;
    }
    if (IsRentedCar(vID))
    {
        SendClientMessage(playerid, -1, "This car is {3399CC}already rented{FFFFFF} by someone else!");
        return 1;
    }
    if (GetPVarInt(playerid, "Renting") == 1)
    {
        SendClientMessage(playerid, -1, "You {3399CC}already rent{FFFFFF} a car!");
        return 1;
    }
    if (!CanAffordRental(playerid))
    {
        new String[128];
        format(String, 128, "You don't have money to rent this! {3399CC}(Cost: %d)", RENT_COST);
        SendClientMessage(playerid, -1, String);
        return 1;
    }
    IsRented[vID] = 1;
    TogglePlayerControllable(playerid, 1);
    SetPVarInt(playerid, "CarRentID", vID);
    SetPVarInt(playerid, "Renting", 1);
    new String[128];
    format(String, 128, "~w~you have rented this car~n~it costed you: ~g~%d$", RENT_COST);
    GameTextForPlayer(playerid, String, 4000, 4);
    RentedBy[vID] = GetName(playerid);
    GivePlayerMoney(playerid, -RENT_COST);
    SendClientMessage(playerid, -1, "{3399CC}Car rented,{FFFFFF} you may now turn on the engine!");
    return 1;
}

stock CreateRentalVehicle(iModel, Float:fX, Float:fY, Float:fZ, Float:fAngle, iCol1, iCol2)
{
    new
        TMP;

    TMP = AddStaticVehicle(iModel, Float:fX, Float:fY, Float:fZ, Float:fAngle, iCol1, iCol2);

    SetVehicleNumberPlate(TMP, "Rental");
    SetVehicleToRespawn(TMP);

    IsRentable[TMP] = 1;
    IsRented[TMP] = 0;
    RentedBy[TMP] = "No-one";
    return TMP;
}

stock GetName(playerid)
{
    new
        Name[24];
    GetPlayerName(playerid, Name, 24);
    return Name;
}

stock IsRentableCar(vehicleid)
{
    if (IsRentable[vehicleid])
        return 1;
    return 0;
}

stock CanAffordRental(playerid)
{
    new
        Money;
    Money = GetPlayerMoney(playerid);
    if (Money >= RENT_COST)
        return 1;
    return 0;
}

stock IsRentedCar(vehicleid)
{
    if (IsRented[vehicleid])
        return 1;
    return 0;
}
help me please asap....
Reply
#8

i give +rep the one who can help me..
Reply
#9

You need to return 1 at the end of every command.

pawn Код:
public OnPlayerCommandText(...)
{
    if(strcmp(...))
    {
        // Command code
        return 1;
    }
    return 0;
}
Reply
#10

Quote:
Originally Posted by MP2
Посмотреть сообщение
You need to return 1 at the end of every command.

pawn Код:
public OnPlayerCommandText(...)
{
    if(strcmp(...))
    {
        // Command code
        return 1;
    }
    return 0;
}
not working bro all command i put is not working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)