public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == PLAYER_STATE_DRIVER)
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == gangcar1)
{
if(gTeam[playerid] == TEAM_YOURGANGNAME)
{
return 1;
}
else if(gTeam[playerid] != TEAM_YOURGANGNAME)
{
SendClientMessage(playerid, COLOR_ORANGE, "[INFO] This car is only for gang members of YOURGANGNAME ");
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
new gangcar;
gangcar = The addstaticvehicle function from savedpositions.txt
|
Originally Posted by 0ne
Save a vehicle where you would like to, then add it to your gamemode, Search for OnPlayerStateChange callback, in that callback write like this:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == PLAYER_STATE_DRIVER)
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == gangcar1)
{
if(gTeam[playerid] == TEAM_YOURGANGNAME)
{
return 1;
}
else if(gTeam[playerid] != TEAM_YOURGANGNAME)
{
SendClientMessage(playerid, COLOR_ORANGE, "[INFO] This car is only for gang members of YOURGANGNAME ");
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
Код:
new gangcar; Код:
gangcar = The addstaticvehicle function from savedpositions.txt |
|
Originally Posted by 0ne
Save a vehicle where you would like to, then add it to your gamemode, Search for OnPlayerStateChange callback, in that callback write like this:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == PLAYER_STATE_DRIVER)
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == gangcar1)
{
if(gTeam[playerid] == TEAM_YOURGANGNAME)
{
return 1;
}
else if(gTeam[playerid] != TEAM_YOURGANGNAME)
{
SendClientMessage(playerid, COLOR_ORANGE, "[INFO] This car is only for gang members of YOURGANGNAME ");
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
Код:
new gangcar; Код:
gangcar = The addstaticvehicle function from savedpositions.txt |
new gTeam[MAX_PLAYERS];
#define TEAM_BALLAS 0 #define TEAM_GROVE 1
|
Originally Posted by 0ne
ontop:
Код:
new gTeam[MAX_PLAYERS]; Код:
#define TEAM_BALLAS 0 #define TEAM_GROVE 1 |