21
« Dátum: 2020. április 09. - 20:06:41 »
Parancsolj:
#include <a_samp>
#include <zcmd>
#include <core>
#include <float>
#include <streamer>
#pragma tabsize 0
#define COLOR_WHITE 0xFFFFFFFF
#define GELTONA 0xFFFF00FF
#define BALTA 0xFFFFFFFF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
new SpawnedVehicles[MAX_PLAYERS];
new VehicleNames[212][] = {
{"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
{"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
{"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
{"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
{"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Trailer 1"},{"Previon"},
{"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
{"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
{"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},
{"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
{"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
{"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
{"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
{"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
{"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
{"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
{"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
{"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
{"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
{"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
{"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
{"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
{"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
{"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
{"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
{"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
{"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
{"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
{"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
{"Utility Trailer"}
};
forward HostName();
forward FixAllCar();
new FixTimer;
forward myTimer();
main( ) { }
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public OnPlayerConnect(playerid)
{
SendClientMessage( playerid, COLOR_WHITE, "Üdvözöllek a szerveren!" );
SendClientMessage( playerid, COLOR_WHITE, "Parancsok: /godbe, /godki" );
return 1;
}
CMD:godbe(playerid, params[])
{
SetPlayerHealth(playerid, 99999);
SendClientMessage(playerid, COLOR_WHITE,"Godmode bekapcsolva");
return 1;
}
CMD:godki(playerid, params[])
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_WHITE,"Godmode kikapcsolva");
return 1;
}
CMD:v(playerid, params[])
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);
if(!strlen(tmp)) return
SendClientMessage(playerid, COLOR_RED, "{FFFFFF}Használat: {FFFFFF}/v [modellid/járműnév]");
new car;
new string[128];
new colour1, colour2;
if(!IsNumeric(tmp))
car = GetVehicleModelIDFromName(tmp);
else car = strval(tmp);
if(car < 400 || car > 611) return SendClientMessage(playerid, BALTA, "{FF0000}Hiba: Nincs ilyen jármű!");
if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);
new Float:X,Float:Y,Float:Z;
new Float:Angle,int1;
new LVehicleID = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
int1 = GetPlayerInterior(playerid);
SpawnedVehicles[playerid] = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
LinkVehicleToInterior(LVehicleID,int1);
PlayerPlaySound(playerid,1085,0,0,0);
PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0);
format(string, sizeof(string), "{0EDF0E} %s {FFFFFF}lespawnolva!", VehicleNames[car-400], car, colour1, colour2);
return SendClientMessage(playerid,COLOR_ORANGE,string);
}
CMD:crs(playerid, params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) return 0; //hanem rcon admin akkor Ismeretlen parancs legyen
SendClientMessage(playerid, COLOR_GREY, "Járművek Respawnolva!");
GameTextForAll("~n~~n~~n~~n~~n~~n~~r~Jarmuvek ~g~respawnolva Admin altal!", 3000,3);
for(new cars=0; cars<MAX_VEHICLES; cars++)
{
if(!VehicleOccupied(cars))
{
SetVehicleToRespawn(cars);
}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid,0);
TogglePlayerClock(playerid,0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnPlayerDisconnect(playerid)
{
DestroyVehicle(SpawnedVehicles[playerid]);
SpawnedVehicles[playerid] = 0;
return 0;
}
public OnGameModeInit()
{
SetTimer("myTimer", 3000, true);
FixTimer = SetTimer("FixAllCar",500,true);
SetGameModeText("text");
ShowPlayerMarkers(1);
ShowNameTags(1);
AddPlayerClass(298,1957.9716,-2462.0664,13.5391,149.4223,0,0,0,0,0,0);
AddStaticVehicle(411,1965.3927,-2519.0195,13.2496,1.0965,123,1); // inf2
AddStaticVehicle(411,1962.4984,-2518.7908,13.2968,359.9989,64,1); // inf1
AddStaticVehicle(562,1959.4360,-2518.8716,13.2064,0.4100,35,1); // elegy1
AddStaticVehicle(562,1956.4889,-2519.0950,13.2060,2.2979,17,1); // elegy2
AddStaticVehicle(581,1953.4420,-2519.8047,13.1429,2.8934,58,1); // moci1
AddStaticVehicle(581,1951.5485,-2520.0381,13.1429,1.8147,66,1); // moci2
AddStaticVehicle(510,1949.5963,-2519.8950,13.1557,4.2600,39,39); // mount1
AddStaticVehicle(510,1947.5627,-2520.0378,13.1551,1.5311,46,46); // mount2
return 1;
}
public OnGameModeExit()
{
KillTimer(FixTimer);
return 1;
}
public FixAllCar()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
SetVehicleHealth(vehicleid,1000.0);// ha jármű élete kisebb, mint 1000
RepairVehicle(GetPlayerVehicleID(playerid)); // ez a sor a kasztnit is javítja
}
}
}
forward VehicleOccupied(vehicleid);
GetVehicleModelIDFromName(vname[])
{
for(new i = 0; i < 211; i++)
{
if ( strfind(VehicleNames[i], vname, true) != -1 )
return i + 400;
}
return -1;
}
stock IsNumeric(string[])
{
for (new i = 0, j = strlen(string);
i < j; i++)
{
if (string[i] > '9' || string[i] < '0')
return 0;
}
return 1;
}
public VehicleOccupied(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInVehicle(i,vehicleid)) return 1;
}
return 0;
}
public myTimer()
{
new
myMsg = random(3);
switch(myMsg)
{
case 0: SendRconCommand("hostname dsds");
case 1: SendRconCommand("hostname asasa");
case 2: SendRconCommand("hostname wqwqwqwq");
}
return 1;
}