#include <YSI\y_groups>
#include <YSI\y_classes>
new
Group:gHoodRats, //So this is team one my choosen name is HoodRats as you can see.
Group:gGSF, //group 2
Group:gSBF, //group3
Group:gTDF //group 4
;
gHoodRats = Group_Create("HoodRats"); //Basically we set group one.
gGSF = Group_Create("GSF"); //Group 2
gSBF = Group_Create("SBF"); //Group 3
gTDF = Group_Create("TDF"); //Group 4
Class_AddWithGroupSet(gHoodRats,15, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gHoodRats,170, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gHoodRats,183, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gHoodRats,263, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
//GroveStreet
Class_AddWithGroupSet(gGSF,270, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gGSF,105, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gGSF,106, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gGSF,107, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
//SBF
Class_AddWithGroupSet(gSBF,0, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gSBF,105, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gSBF,106, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gSBF,107, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
//TDF
Class_AddWithGroupSet(gTDF,269, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gTDF,105, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gTDF,106, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddWithGroupSet(gTDF,107, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddForGroup(gCrips, 29, 0, 0, 0, 0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddForGroup(gAdmin, 29, 0, 0, 0, 0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddForGroup(gLeader, 29, 0, 0, 0, 0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
Class_AddForGroup(gVIP, 29, 0, 0, 0, 0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
new
Group:gHoodRats, //So this is team one my choosen name is HoodRats as you can see.
Group:gGSF, //group 2
Group:gSBF, //group3
Group:gTDF //group 4
;
Class_AddWithGroupSet(group, skin, x, y, z, a, (weapon, amm)…);
WEAPON_BRASSKNUCKLE
WEAPON_GOLFCLUB
WEAPON_NITESTICK
WEAPON_KNIFE
WEAPON_BAT
WEAPON_SHOVEL
WEAPON_POOLSTICK
WEAPON_KATANA
WEAPON_CHAINSAW
WEAPON_DILDO
WEAPON_DILDO2
WEAPON_VIBRATOR
WEAPON_VIBRATOR2
WEAPON_FLOWER
WEAPON_CANE
WEAPON_GRENADE
WEAPON_TEARGAS
WEAPON_MOLTOV
WEAPON_COLT45
WEAPON_SILENCED
WEAPON_DEAGLE
WEAPON_SHOTGUN
WEAPON_SAWEDOFF
WEAPON_SHOTGSPA
WEAPON_UZI
WEAPON_MP5
WEAPON_AK47
WEAPON_M4
WEAPON_TEC9
WEAPON_RIFLE
WEAPON_SNIPER
WEAPON_ROCKETLAUNCHER
WEAPON_HEATSEEKER
WEAPON_FLAMETHROWER
WEAPON_MINIGUN
WEAPON_SATCHEL
WEAPON_BOMB
WEAPON_SPRAYCAN
WEAPON_FIREEXTINGUISHER
WEAPON_CAMERA
WEAPON_PARACHUTE
WEAPON_MP5 //Weapon name
500 //Bullets
WEAPON_ARMOUR
50 //How much armor player will have
And this is how it needs to look:
Class_AddWithGroupSet(gTDF,107, 1958.3783, 1343.1572, 15.3746, 0.0, WEAPON_MP5, 500, WEAPON_ARMOUR, 50, WEAPON_DEAGLE, 200);
public OnPlayerRequestSpawn(playerid)
{
Group_SetPlayer(gHoodRats, playerid, false); // Remove from the group HoodRats
Group_SetPlayer(gGSF, playerid, false); //Remove from the group GSF
Group_SetPlayer(gSBF, playerid, false); //Remove from the group SBF
Group_SetPlayer(gTDF, playerid, false); //Remove from the group TDF
return 1;
}
enum TeamCars //Making enum for team cars..
{
GroveStreet,
GroveStreet1,
}
new Cars[TeamCars]; //variable
public OnGameModeInit()
{
Cars[GroveStreet] = AddStaticVehicleEx(492,2499.5000000,-1655.4000200,13.3000000,60.0000000,18,20,15); //Greenwood //sets Grovestreet car..
Cars[GroveStreet1] = AddStaticVehicleEx(412,2503.8000500,-1684.6999500,13.5000000,24.0000000,12,20,15);
return 1;
}
So here you will see example how it besaclly looksAnd which is long way... (But ain't bad to)
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER) //checks if player is in driver state
{
new CarCheck = GetPlayerVehicleID(playerid); //variable
if(CarCheck == Cars[GroveStreet]) //check if player is in grovestreet car
{
if (Group_GetPlayer(gGSF, playerid)) //Check if player is in grove street
{
SendClientMessage(playerid, COLOR_RED, "* %s spins a key and tries to start vehicle engine.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't in team Grove Street Crips");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
if(CarCheck == Cars[GroveStreet1]) //check if player is in grovestreet car
{
if (Group_GetPlayer(gGSF, playerid)) //Check if player is in grove street
{
SendClientMessage(playerid, COLOR_RED, "* %s spins a key and tries to start vehicle engine.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't in team Grove Street Crips");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER) //checks if player is in driver state
{
new CarCheck = GetPlayerVehicleID(playerid); //variable
if(CarCheck == Cars[GroveStreet] || Cars[GroveStreet1] || Cars[GroveStreet2]) //check if player is in grovestreet car
{
if (Group_GetPlayer(gGSF, playerid)) //Check if player is in grove street
{
SendClientMessage(playerid, COLOR_RED, "* %s spins a key and tries to start vehicle engine.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't in team Grove Street Crips");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
//If you have gangs or multiple group cars....
if(CarCheck == Cars[Bloodz] || Cars[Bloodz1] || Cars[Bloodz2]) //check if player is in grovestreet car
{
if (Group_GetPlayer(gBloodz, playerid)) //Check if player is in grove street
{
SendClientMessage(playerid, COLOR_RED, "* %s spins a key and tries to start vehicle engine.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't in team Bloodz");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
}
return 1;
}
public OnGameModeInit()
{
Group_SetGlobalCommand(YCMD:kill, false);//Sets command for all players to false!
Group_SetCommand(gGSF, YCMD:kill, true);//Sets command for gGSF members to true!
return 1;
}
YCMD:kill(playerid, params[], help)//params[] = What this does is create one variable at a suitable size [256 is NOT a suitable size!], but here we are not using it..
{
SetPlayerHealth(playerid, 0.0); // Sets players Health to 0 Also if you want you can add SendCliendMessage
return 1;
}
One note: I think that WEAPON_DROWN and WEAPON_COLLISION are only usable in OnPlayerDeatch as a reason, not a valid weapons
|
Cars[GroveStreet] = AddStaticVehicleEx(492,2499.5000000,-1655.4000200,13.3000000,60.0000000,18,20,15); |
public OnPlayerStateChange(playerid, newstate, oldstate)
{
switch(newstate) {
case PLAYER_STATE_ONFOOT: {
switch(oldstate) {
case PLAYER_STATE_DRIVER: OnPlayerExitVehicle(playerid,255);
case PLAYER_STATE_PASSENGER: OnPlayerExitVehicle(playerid,255);
}
}
}
new vehicle = GetVehicleModel(GetPlayerVehicleID(playerid));
new Float:PX, Float:PY, Float:PZ;
if(vehicle == 492 || vehicle == 412 )
{
if(gTeam[playerid] != TEAM_GROVE) //Or whatever
{
GetPlayerPos(playerid,PX,PY,PZ);
SetPlayerPos(playerid,PX,PY,PZ+3);
SendClientMessage(playerid,COLOR_RED,"[ERROR]: This car is locked only grove street members can use it.");
}
}
}
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER) //checks if player is in driver state
{
new CarCheck = GetPlayerVehicleID(playerid); //variable
if(CarCheck == Cars[GroveStreet]) //check if player is in grovestreet car
{
if (Group_GetPlayer(gGSF, playerid)) //Check if player is in grove street
{
SendClientMessage(playerid, COLOR_RED, "* %s spins a key and tries to start vehicle engine.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't in team Grove Street Crips");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
if(CarCheck == Cars[GroveStreet1]) //check if player is in grovestreet1 car
{
if (Group_GetPlayer(gGSF, playerid)) //Check if player is in grove street
{
SendClientMessage(playerid, COLOR_RED, "* %s spins a key and tries to start vehicle engine.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You aren't in team Grove Street Crips");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
}