14.09.2011, 08:47
I got a /factionint which puts in a interior for a faction HQ, ATM It only got 3 ints, anyone who can guide me thru on how to script more in?
if(strcmp(cmd,"/factionint",true)==0) { if(IsPlayerConnected(playerid)) { new fam = PlayerInfo[playerid][pMember]; x_job = strtok(cmdtext, idx); if(PlayerInfo[playerid][pMember] <= 6) { return 1; } if(PlayerInfo[playerid][pRank] != 6) { SendClientMessage(playerid, COLOR_GRAD2, " You are not an Faction Leader !"); return 1; } if(!strlen(x_job)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /factionint [Faction Interior]"); return 1; } if(strcmp(x_job,"1",true) == 0) // Crackden { FamilyInfo[fam][FamilyInterior] = 1; FamilyInfo[fam][FamilyExit][0] = 318.6156; FamilyInfo[fam][FamilyExit][1] = 1115.3356; FamilyInfo[fam][FamilyExit][2] = 1083.8828; } else if(strcmp(x_job,"2",true) == 0) // Ryders { FamilyInfo[fam][FamilyInterior] = 2; FamilyInfo[fam][FamilyExit][0] = 2468.5654; FamilyInfo[fam][FamilyExit][1] = -1698.1985; FamilyInfo[fam][FamilyExit][2] = 1013.5078; } else if(strcmp(x_job,"3",true) == 0) // Cj house { FamilyInfo[fam][FamilyInterior] = 3; FamilyInfo[fam][FamilyExit][0] = 2495.9421; FamilyInfo[fam][FamilyExit][1] = -1692.5475; FamilyInfo[fam][FamilyExit][2] = 1014.7422; } else { SendClientMessage(playerid, COLOR_GREY, " Do not go below 1 or above 3 !"); return 1; } SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have adjusted the Factions Information."); SaveFamilies(); } return 1; } |
(PlayerInfo[playerid][pMember] >= 7 && FamilyInfo[PlayerInfo[playerid][pMember]][FamilyInterior] != 0) // Factions { new fam = PlayerInfo[playerid][pMember]; SetPlayerToTeamColor(playerid); SetPlayerVirtualWorld(playerid,fam); if(FamilyInfo[fam][FamilyInterior] == 1) // Crackden { SetPlayerInterior(playerid,5); DOO_SetPlayerPos(playerid, 309.9930,1122.5713,1083.882; } else if(FamilyInfo[fam][FamilyInterior] == 2) // Ryders House { SetPlayerInterior(playerid,2); DOO_SetPlayerPos(playerid, 2465.8018,-1698.3330,1013.507; } else if(FamilyInfo[fam][FamilyInterior] == 3) // CJs house { SetPlayerInterior(playerid,3); DOO_SetPlayerPos(playerid, 2496.0498,-1694.3333,1014.7422); } return 1; } |
if(strcmp(cmd,"/factionint",true)==0)
{
if(IsPlayerConnected(playerid))
{
new fam = PlayerInfo[playerid][pMember];
x_job = strtok(cmdtext, idx);
if(PlayerInfo[playerid][pMember] <= 6)
{
return 1;
}
if(PlayerInfo[playerid][pRank] != 6)
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not an Faction Leader !");
return 1;
}
if(!strlen(x_job))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /factionint [Faction Interior]");
return 1;
}
if(strcmp(x_job,"1",true) == 0) // Crackden
{
FamilyInfo[fam][FamilyInterior] = 1;
FamilyInfo[fam][FamilyExit][0] = 318.6156;
FamilyInfo[fam][FamilyExit][1] = 1115.3356;
FamilyInfo[fam][FamilyExit][2] = 1083.8828;
}
else if(strcmp(x_job,"2",true) == 0) // Ryders
{
FamilyInfo[fam][FamilyInterior] = 2;
FamilyInfo[fam][FamilyExit][0] = 2468.5654;
FamilyInfo[fam][FamilyExit][1] = -1698.1985;
FamilyInfo[fam][FamilyExit][2] = 1013.5078;
}
else if(strcmp(x_job,"3",true) == 0) // Cj house
{
FamilyInfo[fam][FamilyInterior] = 3;
FamilyInfo[fam][FamilyExit][0] = 2495.9421;
FamilyInfo[fam][FamilyExit][1] = -1692.5475;
FamilyInfo[fam][FamilyExit][2] = 1014.7422;
}
else if(strcmp(x_job,"4",true) == 0) // Og Locs House
{
FamilyInfo[fam][FamilyInterior] = 4; // So 4
FamilyInfo[fam][FamilyExit][0] = yourcoords; // change yourcoods to your X coordinates
FamilyInfo[fam][FamilyExit][1] = yourcoords; // change yourcoods to your Y coordinates
FamilyInfo[fam][FamilyExit][2] = yourcoords; // change yourcoods to your Z coordinates
}
// More interior here
else
{
SendClientMessage(playerid, COLOR_GREY, " Do not go below 1 or above 4 !"); // Changed here
return 1;
}
SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have adjusted the Factions Information.");
SaveFamilies();
}
return 1;
}
(PlayerInfo[playerid][pMember] >= 7 && FamilyInfo[PlayerInfo[playerid][pMember]][FamilyInterior] != 0) // Factions
{
new fam = PlayerInfo[playerid][pMember];
SetPlayerToTeamColor(playerid);
SetPlayerVirtualWorld(playerid,fam);
if(FamilyInfo[fam][FamilyInterior] == 1) // Crackden
{
SetPlayerInterior(playerid,5);
DOO_SetPlayerPos(playerid, 309.9930,1122.5713,1083.882;
}
else if(FamilyInfo[fam][FamilyInterior] == 2) // Ryders House
{
SetPlayerInterior(playerid,2);
DOO_SetPlayerPos(playerid, 2465.8018,-1698.3330,1013.507;
}
else if(FamilyInfo[fam][FamilyInterior] == 3) // CJs house
{
SetPlayerInterior(playerid,3);
DOO_SetPlayerPos(playerid, 2496.0498,-1694.3333,1014.7422);
}
else if(FamilyInfo[fam][FamilyInterior] == 4) // Og Locs house
{
SetPlayerInterior(playerid,3); // Og Locs House Interior
DOO_SetPlayerPos(playerid, 513.882507,-11.269994,1001.565307); // Og Locs House COordinates
}
// More interior here
return 1;
}