Hi guys!
I came with my old script.
Type /undercover and you'll get a red cheetah with an UZI, like was in the GTA:VC!
Press Y key and your siren will appear too!
I came with my old script.
Type /undercover and you'll get a red cheetah with an UZI, like was in the GTA:VC!
Press Y key and your siren will appear too!
Code:
#include <a_samp>
#include <zcmd>
new UndercoverCar[MAX_PLAYERS];
new SirenObject[MAX_VEHICLES];
public OnFilterScriptExit()
{
for(new i; i < MAX_VEHICLES; i++)
{
DestroyObject(SirenObject[i]);
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
if (PRESSED(KEY_YES))
{
if (GetPlayerVehicleID(playerid) == UndercoverCar[playerid])
{
if(SirenObject[GetPlayerVehicleID(playerid)] == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 415)
{
SirenObject[GetPlayerVehicleID(playerid)] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
AttachObjectToVehicle(SirenObject[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
}
}
else if(SirenObject[GetPlayerVehicleID(playerid)] != 0)
{
DestroyObject(SirenObject[GetPlayerVehicleID(playerid)]);
SirenObject[GetPlayerVehicleID(playerid)] = 0;
}
}
}
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
DestroyObject(SirenObject[vehicleid]);
return 1;
}
CMD:undercover(playerid,params[])
{
if(GetPlayerMoney(playerid) >= 5000)
{
if (UndercoverCar[playerid] != 0)
{
DestroyVehicle(UndercoverCar[playerid]);
}
new Float:x,Float:y,Float:z;
GivePlayerMoney(playerid,-5000);
GetPlayerPos(playerid,x,y,z);
UndercoverCar[playerid] = CreateVehicle(415,x,y,z,0,003,003,-1);
PutPlayerInVehicle(playerid,UndercoverCar[playerid],0);
GivePlayerWeapon(playerid,28,5000);
AddVehicleComponent(UndercoverCar[playerid], 1098);
SendClientMessage(playerid,-1,"You bought an undercover SAPD cheetah!");
SendClientMessage(playerid,-1,"You got an UZI with 5000 ammo!");
SendClientMessage(playerid,-1,"For siren press 'Y'!");
}
else SendClientMessage(playerid,-1,"Not enough money! (5000$)");
return 1;
}