Jump to content
  • 0

Masina Personala


ToX1c

Question

Salut cum fac si eu cand cineva se urca in masina mea personala sa il dea jos cand ii apare mesajul

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(!ispassenger)
	{
		new id = GetVehicleID(vehicleid);
		if(IsValidVehicle(id) && VehicleCreated[id] == VEHICLE_PLAYER)
		{
			new msg[128];
			format(msg, sizeof(msg), "This vehicle belongs to %s", VehicleOwner[id]);
			SendClientMessage(playerid, COLOR_GREY, msg);
		}
	}
	return 1;
}

cum am eu aici pot sa conduc masina la altcineva.

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(!ispassenger)
	{
		new id = GetVehicleID(vehicleid);
		if(IsValidVehicle(id) && VehicleCreated[id] == VEHICLE_PLAYER)
		{
			new msg[128];
			format(msg, sizeof(msg), "This vehicle belongs to %s", VehicleOwner[id]);
			SendClientMessage(playerid, COLOR_GREY, msg);
			RemovePlayerFromVehicle(playerid);
		}
	}
	return 1;
}

Link to comment
Share on other sites

public OnPlayerEnterVehicle ( playerid , vehicleid , ispassenger )

{

    if ( !ispassenger )

    {

        new

  id = GetVehicleID ( vehicleid )        ,

  string                  [    128    ]

        ;

        if ( VehicleOwner [ id ] ) return ( 1 ) ;

        if ( IsValidVehicle ( id ) && VehicleCreated [ vehicleid ] == VEHICLE_PLAYER )

        {

            if ( !VehicleOwner [ id ] )

   

            {

                RemovePlayerFromVehicle ( playerid ) ;

                format ( string , sizeof ( string ) , "This vehicle belongs to %s" , VehicleOwner [ id ] ) ;

                SendClientMessage ( playerid , COLOR_GREY , string ) ;

            }

        }

    }

    return ( 1 ) ;

}

Link to comment
Share on other sites

C:\Documents and Settings\Ionut\Desktop\filterscripts\avs.pwn(1604) : error 033: array must be indexed (variable "VehicleOwner")
C:\Documents and Settings\Ionut\Desktop\filterscripts\avs.pwn(1607) : error 033: array must be indexed (variable "VehicleOwner")
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Linia 1603 -
if (VehicleOwner [id]) return (1);
Linia 1607 -
if (!VehicleOwner [id])

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.