spawn like cheat - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: spawn like cheat (
/showthread.php?tid=142648)
spawn like cheat -
sansko - 19.04.2010
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)
Re: spawn like cheat -
Andy_McKinley - 19.04.2010
No need to create your own topic, you can suggest it
here!
Re: spawn like cheat -
Jeffry - 19.04.2010
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.
Re: spawn like cheat -
sansko - 19.04.2010
thanks i'm gonna test it
Re: spawn like cheat -
RyDeR` - 19.04.2010
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