15.08.2012, 07:44
Guys i use below codes. When i choose pilot i can sit in hunter, hydra but not in sparrow which is ok. I did it my self. When i take engineer i can sit in tanks. But when i take Mercenary i can't sit in sparrow why?? I want that mercenary can sit in sparrow only.
Next how can sniper class be invisible from map??
3rd that I USE THIS TO SWITCH CLASS:
But when we chose next class, we have previous class weapons. So how can we reset weapons (no weapons)?? when choosing class with /sc
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new Float:PosX,Float:PosY,Float:PosZ,model = GetVehicleModel(vehicleid);
//Sparrow=======================================================================
if(model == 447)//Sparrow
{
if(GetVehicleModel(vehicleid) == 447 && gPlayerClass[playerid] == ASSAULT)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Mercenary to Fly Sea Sparrow!");
}
}
if(model == 447)//Sparrow
{
if(GetVehicleModel(vehicleid) == 447 && gPlayerClass[playerid] == SNIPER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Mercenary to Fly Sea Sparrow!");
}
}
if(model == 447)//Sparrow
{
if(GetVehicleModel(vehicleid) == 447 && gPlayerClass[playerid] == ENGINEER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Mercenary to Fly Sea Sparrow!");
}
}
if(model == 447)//Sparrow
{
if(GetVehicleModel(vehicleid) == 447 && gPlayerClass[playerid] == JETTROOPER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Mercenary to Fly Sea Sparrow!");
}
}
if(model == 447)//Sparrow
{
if(GetVehicleModel(vehicleid) == 447 && gPlayerClass[playerid] == PILOT)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Mercenary to Fly Sea Sparrow!");
}
}
//Tank==========================================================================
if(model == 432)//Tank
{
if(GetVehicleModel(vehicleid) == 432 && gPlayerClass[playerid] == ASSAULT)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Engineer to Drive Tank!");
}
}
if(model == 432)//Tank
{
if(GetVehicleModel(vehicleid) == 432 && gPlayerClass[playerid] == SNIPER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Engineer to Drive Tank!");
}
}
if(model == 447)//Sparrow
{
if(GetVehicleModel(vehicleid) == 447 && gPlayerClass[playerid] == MERCENARY)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Engineer to Drive Tank!");
}
}
if(model == 432)//Tank
{
if(GetVehicleModel(vehicleid) == 432 && gPlayerClass[playerid] == JETTROOPER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Engineer to Drive Tank!");
}
}
if(model == 432)//Tank
{
if(GetVehicleModel(vehicleid) == 432 && gPlayerClass[playerid] == PILOT)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Engineer to Drive Tank!");
}
}
//Hydra=========================================================================
if(model == 520)//Hydra
{
if(GetVehicleModel(vehicleid) == 520 && gPlayerClass[playerid] == ASSAULT)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hydra!");
}
}
if(model == 520)//Hydra
{
if(GetVehicleModel(vehicleid) == 520 && gPlayerClass[playerid] == SNIPER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hydra!");
}
}
if(model == 520)//Hydra
{
if(GetVehicleModel(vehicleid) == 520 && gPlayerClass[playerid] == ENGINEER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hydra!");
}
}
if(model == 447)//Sparrow
{
if(GetVehicleModel(vehicleid) == 447 && gPlayerClass[playerid] == MERCENARY)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hydra!");
}
}
if(model == 520)//Hydra
{
if(GetVehicleModel(vehicleid) == 520 && gPlayerClass[playerid] == JETTROOPER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hydra!");
}
}
//Hunter========================================================================
if(model == 425)//Hunter
{
if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == ASSAULT)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hunter!");
}
}
if(model == 425)//Hunter
{
if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == SNIPER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hunter!");
}
}
if(model == 425)//Hunter
{
if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == ENGINEER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hunter!");
}
}
if(model == 447)//Sparrow
{
if(GetVehicleModel(vehicleid) == 447 && gPlayerClass[playerid] == MERCENARY)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hunter!");
}
}
if(model == 425)//Hunter
{
if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == JETTROOPER)
{//then
GetPlayerPos(playerid,PosX,PosY,PosZ);//getting player pos
SetPlayerPos(playerid,PosX,PosY,PosZ);//setting player to same pos to avoid entering vehicle
SendClientMessage(playerid, 0xAA3333AA, "ERROR: You Need to be Pilot to Fly Hunter!");
}
}
return 1;
}
Next how can sniper class be invisible from map??
3rd that I USE THIS TO SWITCH CLASS:
pawn Код:
CMD:sc(playerid,parmas[])
{
SetPlayerHealth(playerid, 0.00);
ResetPlayerWeapons(playerid);
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class (Need No Rank) \nSniper Class (Need Rank 2) \nEngineer Class (Need Rank 4) \nMercenary Class (Need Rank 5 ) \nJet-Trooper Class (Need Rank 6) \nPilot Class (Need Rank 7) ", "Choose","");
return 1;
}