#include <a_samp> #include <a_players> #include <dini> #include <dudb> #include <dutils> #pragma unused ret_memcpy #include <foreach> #include <sscanf2> #include <zcmd> #include <streamer> #include <OPSP> #include <progress> #include <gvc>
CMD:hotwire(playerid, params[]) { new string[128], Float:playerHealth; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); new playerstate = GetPlayerState(playerid), vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid)), vehid = GetPlayerVehicleID(playerid), rnd = Random(1); if(vehmodel == 481 || vehmodel == 509 || vehmodel == 510) return SendClientMessage(playerid, COLOR_GREY, "You can't hotwire a bicycle."); if(playerstate != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not driving a vehicle"); new engine, lights, alarm, doors, bonnet, boot, objective; GetVehicleParamsEx(vehid, engine, lights, alarm, doors, bonnet, boot, objective); if(engine) return SendClientMessage(playerid, COLOR_GREY, "The vehicle's engine is already on."); if(rnd == 0) { format(string, sizeof(string), "* %s has tried to hotwire the vehicle's engine, but got shocked."); GetPlayerHealth(playerid, playerHealth); SetPlayerHealth(playerid, playerHealth - 15); SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(rnd == 1) { format(string, sizeof(string), "* %s has tried to hotwire the vehicle, and the engine started."); SetVehicleParamsEx(vehid, 1, lights, 1, doors, bonnet, boot, objective); SetTimerEx("AlarmOff", 7500, 0, "i", vehid); } return 1; }
error 017: undefined symbol "Random"
A random number ranging from 0 to max-1. |
CMD:hotwire(playerid, params[])
{
new string[128], Float:playerHealth;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
new playerstate = GetPlayerState(playerid), vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid)), vehid = GetPlayerVehicleID(playerid), rnd = random(2);
if(vehmodel == 481 || vehmodel == 509 || vehmodel == 510) return SendClientMessage(playerid, COLOR_GREY, "You can't hotwire a bicycle.");
if(playerstate != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not driving a vehicle");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehid, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine) return SendClientMessage(playerid, COLOR_GREY, "The vehicle's engine is already on.");
if(rnd == 0)
{
format(string, sizeof(string), "* %s has tried to hotwire the vehicle's engine, but got shocked.");
GetPlayerHealth(playerid, playerHealth);
SetPlayerHealth(playerid, playerHealth - 15);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}
if(rnd == 1)
{
format(string, sizeof(string), "* %s has tried to hotwire the vehicle, and the engine started.");
SetVehicleParamsEx(vehid, 1, lights, 1, doors, bonnet, boot, objective);
SetTimerEx("AlarmOff", 7500, 0, "i", vehid);
}
return 1;
}