31.08.2015, 20:58
Quote:
A little bug, It removes me from every car in the map, while I want it just for the 5 cars from GSF. If you're not a GSF member it removes me from everycar in the map. Please help, how do I change it to just: If you're not a GSF member you cannot drive a GSF vehicle.
PHP код:
|
PHP код:
new bool:v_clan_gsf[MAX_VEHICLES];
public OnGameModeInit() {
//... = CreateVehicle();
v_clan_gsf[1] = true; // Vehicle ID 1 in clan GSF
v_clan_gsf[20] = true; // etc..
v_clan_gsf[10] = true; // EOF Vehicles of clan GSF
return true;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(v_clan_gsf[vehicleid])
{
if(PlayerInfo[playerid][MemberGSF] >= 1 && PlayerInfo[playerid][LeaderGSF] >= 1)
{
SendClientMessage(playerid, COLOR_LIMEGREEN, "You have entered your organization vehicle!");
}
else
{
new
Float:x, Float:y, Float:z
;
GetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_RED, "Error: You are not a member of Grove Street Families!");
SetPlayerPos(playerid, x, y, z);
// Or RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}