#1

can anyone help tranform this into when he spawns one it destroy's the old one?
otherwise they can spam it
pawn Код:
dcmd_v(playerid,params[])
{
        new Float:x, Float:y, Float:z;

        if(!strlen(params)) return SendClientMessage(playerid, l_red, "USAGE : /vehicle [Vehicle name]");

        new vehicle = GetVehicleModelIDFromName(params);

        if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "ERROR : That vehicle name was not found");
        if(vehicle == 432) return SendClientMessage(playerid, red, "You cant use that car");
        if(vehicle == 425) return SendClientMessage(playerid, red, "You cant use that helicopter");
        if(vehicle == 520) return SendClientMessage(playerid, red, "You cant use that plane");
        new Float:a;
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);

        if(IsPlayerInAnyVehicle(playerid) == 1)
        {
            GetXYInFrontOfPlayer(playerid, x, y, 8);
        }
        else
        {
            GetXYInFrontOfPlayer(playerid, x, y, 5);
        }

        new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
        LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
        PutPlayerInVehicle(playerid, PlayersVehicle, 0);
        return 1;
}
Reply
#2

Global Variable:
new PlayerCar[MAX_PLAYERS];

pawn Код:
dcmd_v(playerid,params[])
{
        new Float:x, Float:y, Float:z;

        if(!strlen(params)) return SendClientMessage(playerid, l_red, "USAGE : /vehicle [Vehicle name]");

        new vehicle = GetVehicleModelIDFromName(params);

        if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "ERROR : That vehicle name was not found");
        if(vehicle == 432) return SendClientMessage(playerid, red, "You cant use that car");
        if(vehicle == 425) return SendClientMessage(playerid, red, "You cant use that helicopter");
        if(vehicle == 520) return SendClientMessage(playerid, red, "You cant use that plane");
        DestroyVehicle(PlayerCar[playerid]);
        new Float:a;
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);

        if(IsPlayerInAnyVehicle(playerid) == 1)
        {
            GetXYInFrontOfPlayer(playerid, x, y, 8);
        }
        else
        {
            GetXYInFrontOfPlayer(playerid, x, y, 5);
        }

        PlayerCar[playerid] = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
        LinkVehicleToInterior(PlayerCar[playerid], GetPlayerInterior(playerid));
        PutPlayerInVehicle(playerid, PlayerCar[playerid], 0);
        return 1;
}
try that
Reply
#3

In your signature it says you're scripting for cash and u cant make that old vehicle cant dissapear after spawning another? Hmpf
Reply
#4

@-/!\-
You have a point.
Reply
#5

Quote:
Originally Posted by -/!\-
Посмотреть сообщение
In your signature it says you're scripting for cash and u cant make that old vehicle cant dissapear after spawning another? Hmpf
im saying basics well i made my own admin system fron scratch made a hole rp gm from scratch and i have a server full so yeh, mr.i_know_everything
Reply
#6

Ontopic, how's it working out?
Reply
#7

Quote:
Originally Posted by Bessensap
Посмотреть сообщение
Ontopic, how's it working out?
worked fine thanks i was thinking of vars but i didnt figure it out how xD
but thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)