09.08.2013, 10:42
(
Последний раз редактировалось Fredx; 11.10.2014 в 14:34.
)
archive
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) { new PlayerVehicle = GetVehicleFileID(GetPlayerVehicleID(playerid)); new ftext[20]; if(Vehicles[PlayerVehicle][Faction] != 0 && Vehicles[PlayerVehicle][Faction] != PlayerInfo[playerid][pMember]) { if(Vehicles[PlayerVehicle][Faction] == 1) { ftext = "LSPD"; } else if(Vehicles[PlayerVehicle][Faction] == 2) { ftext = "FBI"; } else if(Vehicles[PlayerVehicle][Faction] == 3) { ftext = "RCSD"; } else if(Vehicles[PlayerVehicle][Faction] == 4) { ftext = "LSFMD"; } else if(Vehicles[PlayerVehicle][Faction] == 5) { ftext = "National Guards"; } else if(Vehicles[PlayerVehicle][Faction] == 6) { ftext = "Senate"; } else if(Vehicles[PlayerVehicle][Faction] == 7) { ftext = "Secret Service"; } else if(Vehicles[PlayerVehicle][Faction] == 8) { ftext = "Hitman Agency"; } else if(Vehicles[PlayerVehicle][Faction] == 9) { ftext = "News Agency"; } else if(Vehicles[PlayerVehicle][Faction] == 10) { ftext = "Taxi Cab Company"; } format( string, sizeof( string ), "This vehicle is only usable by {FF6347}%s{AFAFAF}.", ftext); SendClientMessage( playerid, COLOR_GREY, string); RemovePlayerFromVehicle(playerid); } }
if(strcmp(cmdtext,"/policespawn",true) ==0 )
{
if(IsPlayerInRangeOfPoint(playerid,5,1573.9717,-1696.8590,6.2188))
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1) // assuming your LSPD Faction is id 1
{
ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST,"Vehicles","LSPD Cruiser\nSFPD Cruiser\nLVPD Cruiser\nRancher\nSWAT Tank\nEnforcer\nFBI Truck","Spawn","Exit");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not a member of the LSPD.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not at the vehicle spawn checkpoint.");
return 1;
}
}
Код:
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) { new PlayerVehicle = GetVehicleFileID(GetPlayerVehicleID(playerid)); new ftext[20]; if(Vehicles[PlayerVehicle][Faction] != 0 && Vehicles[PlayerVehicle][Faction] != PlayerInfo[playerid][pMember]) { if(Vehicles[PlayerVehicle][Faction] == 1) { ftext = "LSPD"; } else if(Vehicles[PlayerVehicle][Faction] == 2) { ftext = "FBI"; } else if(Vehicles[PlayerVehicle][Faction] == 3) { ftext = "RCSD"; } else if(Vehicles[PlayerVehicle][Faction] == 4) { ftext = "LSFMD"; } else if(Vehicles[PlayerVehicle][Faction] == 5) { ftext = "National Guards"; } else if(Vehicles[PlayerVehicle][Faction] == 6) { ftext = "Senate"; } else if(Vehicles[PlayerVehicle][Faction] == 7) { ftext = "Secret Service"; } else if(Vehicles[PlayerVehicle][Faction] == 8) { ftext = "Hitman Agency"; } else if(Vehicles[PlayerVehicle][Faction] == 9) { ftext = "News Agency"; } else if(Vehicles[PlayerVehicle][Faction] == 10) { ftext = "Taxi Cab Company"; } format( string, sizeof( string ), "This vehicle is only usable by {FF6347}%s{AFAFAF}.", ftext); SendClientMessage( playerid, COLOR_GREY, string); RemovePlayerFromVehicle(playerid); } } |
if(strcmp(cmd, "/policespawn", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5,1573.9717,-1696.8590,6.2188))
{
if(playerInfo[playerid][pTeam] == 1) // assign the value to your desired team
{
ShowPlayerDialog(playerid, 8437, DIALOG_STYLE_LIST, "LSPD Vehicles", "LVPD\nLSPD\nSFPD\nMaverick\nRanger\nFBI", "Choose", "Exit");
}
else return SendClientMessage(playerid, -1, "You are not in the LSPD!");
}
}
// put this somewhere in OnDialogResponse
if(dialogid == 8437)
{
if(!reponse) return SendClientMessage(playerid, -1, "You cancelled selection."); // if he pressed escape/exit
if(response) // if he clicked get car
{
// in here you add the code for spawning the vehicle, make sure it's about 5 away from them so they dont get stuck!
}
}