20.03.2017, 01:39
https://sampforum.blast.hk/showthread.php?tid=160810
I tried this, added it to my gamemode and compiled without any errors. However when I tried to test the script ingame, it simply didn't work. I tried all different methods but the find any errors to begin a bug fix.
Any idea why?
I tried this, added it to my gamemode and compiled without any errors. However when I tried to test the script ingame, it simply didn't work. I tried all different methods but the find any errors to begin a bug fix.
Any idea why?
Код:
#define GANG_CIV 0
#define GANG_US 1
#define GANG_T 2
#define GANG_PMC 3
#define GANG_UK 4
enum TeamVehs
{
USveh,
UKveh,
Taliveh,
PMCveh
}
new gTeam[MAX_PLAYERS];
new Veh[TeamVehs];
public OnGameModeInit()
{
AddStaticVehicle(543,-741.3320,2750.9011,47.0458,181.2065,255,255); // Sadler (CIV)
Veh[Taliveh] = AddStaticVehicle(455,-1453.3641,2624.9502,56.2726,270.7139,255,255); // Flatbed (Tali)
Veh[PMCveh] = AddStaticVehicle(487,-655.3591,949.7514,12.2784,93.0401,33,33); // Maverick (PMC)
Veh[USveh] = AddStaticVehicle(548,328.1077,1850.7454,19.1915,90.0070,81,81); // Cargobob (US)
Veh[UKveh] = AddStaticVehicle(520,-1457.0353,501.5562,18.9917,269.4383,0,0); // Hydra (UK)
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new VehCheck = GetPlayerVehicleID(playerid);
if(VehCheck == Veh[USveh] )
{
if(gTeam[playerid] == GANG_US)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "{ff6347}Error: You don't have access to this vehicle!");
return 1;
}
}
if(VehCheck == Veh[Taliveh] )
{
if(gTeam[playerid] == GANG_T)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "{ff6347}Error: You don't have access to this vehicle!");
return 1;
}
}
if(VehCheck == Veh[PMCveh] )
{
if(gTeam[playerid] == GANG_PMC)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "{ff6347}Error: You don't have access to this vehicle!");
return 1;
}
}
if(VehCheck == Veh[UKveh] )
{
if(gTeam[playerid] == GANG_UK)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "{ff6347}Error: You don't have access to this vehicle!");
return 1;
}
}
return 1;
}
return 1;
}


