spawn like cheat
#1

Hello everyone,

I want to have an scrip with spawns an car in front of you like an cheat,
I found much of these things but they are all Cars spawners for more cars and i just want to have an specific car (hydra, id 520)

I hope you can help.

Greetings sansko,

P.s.

I want it as command (jumpjet)
Reply
#2

No need to create your own topic, you can suggest it here!
Reply
#3

pawn Код:
if (strcmp("/hydra", cmdtext, true) == 0)
    {
        new hydra;
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x,y,z);
        GetPlayerFacingAngle(playerid,a);
        hydra=CreateVehicle(520,x,y,z,a,-1,-1,-1);
        PutPlayerInVehicle(playerid, hydra);
        SendClientMessage(playerid, 0xFFFFFFFF, "Hydra cheated!");     
        return 1;
     }
I hope this is what you want.
Reply
#4

thanks i'm gonna test it
Reply
#5

I have created this a couple of months ago; You can use /veh [id] to create a vehicle. It puts you automaticly in the vehicle so..
Also, this will delete the old vehicle automaticly.

Код:
#include <a_samp>

#define dcmd(%1,%2,%3) \
	if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
	
new
	pVehicleID[MAX_PLAYERS],
	pVehCreated[MAX_PLAYERS]
;

dcmd_veh(playerid, params[])
{
	if(!strlen(params)) return SendClientMessage(playerid, 0xE60000FF, "/veh [400 - 611]");
	if(strval(params) < 400 || strval(params) > 611) return SendClientMessage(playerid, 0xE60000FF, "Only ID's between 400 and 611!");
	
	new
		Float: pX,
		Float: pY,
		Float: pZ,
		Float: pA
	;
	GetPlayerPos(playerid, pX, pY, pZ);
	if(!IsPlayerInAnyVehicle(playerid)) GetPlayerFacingAngle(playerid, pA);
	else
	  GetVehicleZAngle(GetPlayerVehicleID(playerid), pA);
	pVehCreated[playerid] = (pVehCreated[playerid] = 1) ? (DestroyVehicle(pVehicleID[playerid])) : (DestroyVehicle(pVehicleID[playerid]));
	pVehicleID[playerid] = CreateVehicle(strval(params), pX, pY, pZ, pA, random(126), random(126), (30 * 60));
	PutPlayerInVehicle(playerid, pVehicleID[playerid], 0);
	pVehCreated[playerid] = 1;
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(veh, 3, cmdtext);
	return 0;
}

public OnPlayerConnect(playerid)
{
  pVehCreated[playerid] = 0;
	return 1;
}

public OnPlayerDisconnect(playerid)
{
  pVehCreated[playerid] = (pVehCreated[playerid] = 1) ? (DestroyVehicle(pVehicleID[playerid])) : (DestroyVehicle(pVehicleID[playerid]));
	pVehCreated[playerid] = 0;
	return 1;
}
For hydra for example use: /veh 520 and you are in a hydra. Have fun

Edit: Indentitation is fucked up :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)