[HELP]CreateVehicle and Lock it
#1

Hello, i have this codec my system admin in GM... But i want, when the vip member (player) use the /vcar and get in car he select with /vsetcar, the car is lock automatic. I mean

/vcar (the car is create and the player is put in) and locked the car for all players automatic.

This is the codec i have.

Код:
dcmd_vcar(playerid, params[])
{
  #pragma unused params
  if(PlayerData[playerid][VIP] == 1)
 	{
	new Float:X,Float:Y,Float:Z,Float:Angle,carid;
	new id = PlayerData[playerid][VIPCar];
	GetPlayerPos(playerid,X,Y,Z);
	GetPlayerFacingAngle(playerid,Angle);
	carid = CreateVehicle(id,X,Y,Z,Angle,-1,-1,50000);
	PutPlayerInVehicle(playerid,carid,0);
	TogglePlayerControllable(playerid,true);
	if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
	SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
	return SendClientMessage(playerid, COLOUR_ORANGE, "You have spawned your VIP Vehicle.");
	} else return SendClientMessage(playerid, COLOUR_WHITE, "SERVER: Unknow command.");
}
How i can add it, for when the car is createm is locked?
Reply
#2

pawn Код:
dcmd_vcar(playerid, params[])
{
    #pragma unused params
    if(PlayerData[playerid][VIP] == 1)
    {
        new Float:X,Float:Y,Float:Z,Float:Angle,carid;
        new id = PlayerData[playerid][VIPCar];
        GetPlayerPos(playerid,X,Y,Z);
        GetPlayerFacingAngle(playerid,Angle);
        carid = CreateVehicle(id,X,Y,Z,Angle,-1,-1,50000);
        PutPlayerInVehicle(playerid,carid,0);
        TogglePlayerControllable(playerid,true);
        LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
        SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
        SendClientMessage(playerid, COLOUR_ORANGE, "You have spawned your VIP Vehicle.");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(i != playerid)
            {
                SetVehicleParamsForPlayer(carid, i, 0, 1);
            }
        }
    }
    else return 0;
}
Reply
#3

Spider, i love you so much... but this happend.

Код:
C:\Documents and Settings\ERO\Escritorio\Mi Servidor SAMP Pruebas Privadas\Server Pruebas Privado (Hosting)\gamemodes\rtscript.pwn(1931) : warning 209: function "dcmd_vcar" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
pawn Код:
dcmd_vcar(playerid, params[])
{
#pragma unused params
if(PlayerData[playerid][VIP] == 1)
{
new Float:X,Float:Y,Float:Z,Float:Angle,carid;
new id = PlayerData[playerid][VIPCar];
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
carid = CreateVehicle(id,X,Y,Z,Angle,-1,-1,50000);
PutPlayerInVehicle(playerid,carid,0);
TogglePlayerControllable(playerid,true);
LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
SendClientMessage(playerid, COLOUR_ORANGE, "You have spawned your VIP Vehicle.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(carid, i, 0, 1);
}
}
}
else return 0;
} //<-- HERE IS THE WARING
Edit: I use the /vcar ingame, and the game is crash
Reply
#4

Sorry for the double post, but is fixed. ^^

Thanks Spider
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)