15.11.2009, 18:03
What will you get out of this tutorial?
Most of you probaly know the /families system in the godfather script/Godfather script edits. At the end of this tutorial you will learn how to get the command to make a family, Learn how to add skins, how to add the /f command and add a family color.
[1]Command to make a Family...
I am going to assume that you are using a blank Godfather script, and if its not been edited you will find command's in your script called /allowcreation and /deletecreation, these should look like this:
If you look at these commands in your script you will see it say some stuff about La Costra Nostra and Yakuza, this is because these commands were originaly made for the factions to create families, Although for this im assuming you want admins to use the commands, so we need to delete thse lines..
and replace them with..
do this for both /allowcreation and /deletecreation so now they are both admin commands and not Factions commands, Now you have got the command ready we will move onto Adding skins.
[2]Adding family skins...
This is the main bit of the tutorial, this is where we add skins for families. Assumeing that you have made someone a family with /allowcreation in game we will make this skin thing...now lets say that you gave someone family slot 5 and he is going to make it Grove. He uses the /adjust command in game to set the Spawn spot, Name, MOTD and i think maybe a few other things... To do the skin we do this in the script and we do this by going to the /clothes command on to script..... in that command there is a line like this..
you need to change this so it sets that varible as the Family, not Faction, so change it to..
now whatever ur family id is, that variable will be it, Although it works a little differently that you think...in our case the slot id is 5..so you expect your pFMember to be 5? well it isnt, it is 4... because on /families it goes from 1,2,3 to 10... but on the script it goes from 0,1,2 to 9.. so in our case the pFMember is 4 even though the slot id is 5....hope that makes sense....
Now you need to use ctrl+F and search for 'public onplayertext' and the will be a big section underneath "switch (SelectCharID[playerid])" and this is where you set up your skins for families. you will see lots of 'case 1: , case 2:' e.t.c. the number after Case is the family id, so in our case Case 4: is what we will be using... before you do anything remove all of those case's, (if you wanna keep /clothes for factions, i will show you how to do that in a second tutoriall....) now add
Or case for whatever family you are making of course..
Now in the 'case' you gotta set the skins and this bit is annoying to do but its pretty simple. before we look at what we put in the 'case' search for.."new joinped" and there will be a big list of numbers this is skins, and this is where we put the grove skins..
the '52' should be how many skins are on that list (starts from 1 i THINK.. ). and you need to add your three skins to the bottom like this:
once you added these you need to add 3 to that '52' so i will make mine 55... Now go back to case and add these lines, edited to fit your script..
So that should work... and if you go to your account or tell your 'friend' with that family to go try /clothes command, it should work...
[3]Setting Family Colors...
You should have a callback called... 'SetPlayerToTeamColor', if not you need to set this at the top of the script:
and you need to add this into your script aswel...
Ok, now make sure that you have got the this called onplayerspawn at the end of it (if its not there)... 'SetPlayerToTeamColor(playerid);' Now on the 'public' bit you need to do something like this (the pFMember is whatever the family slot is - 1...so slot 5 is pFMember is 4...)
Although please make sure you set the color to white for everyone so that everyones default color color is white, so it should look like this at this point..
So, i hope this tutorial helps, ive ran through it pretty fast so if i get feedback that says i should re-do it, i am happy to do so...
Most of you probaly know the /families system in the godfather script/Godfather script edits. At the end of this tutorial you will learn how to get the command to make a family, Learn how to add skins, how to add the /f command and add a family color.
[1]Command to make a Family...
I am going to assume that you are using a blank Godfather script, and if its not been edited you will find command's in your script called /allowcreation and /deletecreation, these should look like this:
Код:
if(strcmp(cmd, "/allowcreation", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pLeader] == 6) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /allowcreation [FamilyNr] [playerid/PartOfName]"); return 1; } new family = strval(tmp); if(family < 1 || family > 10) { SendClientMessage(playerid, COLOR_GREY, " FamilyNr can't be below 1 or above 10 !"); return 1; } if(PlayerInfo[playerid][pLeader] == 5 && family > 5) { SendClientMessage(playerid, COLOR_GREY, " La Cosa Nostra Leader can only take FamilyNr 1 till 5 !"); return 1; } else if(PlayerInfo[playerid][pLeader] == 6 && family < 6) { SendClientMessage(playerid, COLOR_GREY, " Yakuza Leader can only take FamilyNr 6 till 10 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /allowcreation [FamilyNr] [playerid/PartOfName]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { family -= 1; if(FamilyInfo[family][FamilyTaken] == 1) { SendClientMessage(playerid, COLOR_GREY, " That FamilyNr is already taken !" ); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* You've made %s the Leader of FamilyNr %d.",giveplayer,family); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); if(PlayerInfo[playerid][pLeader] == 5) { format(string, sizeof(string), "* La Cosa Nostra Leader %s has made you a Family Leader of FamilyNr %d.",sendername,family); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); } else if(PlayerInfo[playerid][pLeader] == 6) { format(string, sizeof(string), "* Yakuza Leader %s has made you a Family Leader of FamilyNr %d.",sendername,family); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); } format(string, sizeof(string), "%s",giveplayer); strmid(FamilyInfo[family][FamilyLeader], string, 0, strlen(string), 255); FamilyInfo[family][FamilyMembers] ++; FamilyInfo[family][FamilyTaken] = 1; PlayerInfo[giveplayerid][pFMember] = family; SaveFamilies(); } } else { SendClientMessage(playerid, COLOR_GREY, " That player is Offline !"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You are not the Leader of one of the Organisations !"); return 1; } } return 1; } if(strcmp(cmd, "/deletecreation", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pLeader] == 6) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletecreation [FamilyNr]"); return 1; } new family = strval(tmp); if(family < 1 || family > 10) { SendClientMessage(playerid, COLOR_GREY, " FamilyNr can't be below 1 or above 10 !"); return 1; } if(PlayerInfo[playerid][pLeader] == 5 && family > 5) { SendClientMessage(playerid, COLOR_GREY, " La Cosa Nostra Leader can only take FamilyNr 1 till 5 !"); return 1; } else if(PlayerInfo[playerid][pLeader] == 6 && family < 6) { SendClientMessage(playerid, COLOR_GREY, " Yakuza Leader can only take FamilyNr 6 till 10 !"); return 1; } family -= 1; if(FamilyInfo[family][FamilyTaken] != 1) { SendClientMessage(playerid, COLOR_GREY, " That FamilyNr isn't taken !"); return 1; } ClearFamily(family); SaveFamilies(); } else { SendClientMessage(playerid, COLOR_GREY, " You are not the Leader of one of the Organisations !"); return 1; } } return 1; }
Код:
if(PlayerInfo[playerid][pLeader] == 5 && family > 5) { SendClientMessage(playerid, COLOR_GREY, " La Cosa Nostra Leader can only take FamilyNr 1 till 5 !"); return 1; } else if(PlayerInfo[playerid][pLeader] == 6 && family < 6) { SendClientMessage(playerid, COLOR_GREY, " Yakuza Leader can only take FamilyNr 6 till 10 !"); return 1; }
Код:
if(PlayerInfo[playerid][pAdmin] <= 1336) { SendClientMessage(playerid, COLOR_GREY, " Admin 1337+ only!"); return 1; }
[2]Adding family skins...
This is the main bit of the tutorial, this is where we add skins for families. Assumeing that you have made someone a family with /allowcreation in game we will make this skin thing...now lets say that you gave someone family slot 5 and he is going to make it Grove. He uses the /adjust command in game to set the Spawn spot, Name, MOTD and i think maybe a few other things... To do the skin we do this in the script and we do this by going to the /clothes command on to script..... in that command there is a line like this..
Код:
SelectCharID[playerid] = PlayerInfo[playerid][pMember];
Код:
SelectCharID[playerid] = PlayerInfo[playerid][pFMember];
Now you need to use ctrl+F and search for 'public onplayertext' and the will be a big section underneath "switch (SelectCharID[playerid])" and this is where you set up your skins for families. you will see lots of 'case 1: , case 2:' e.t.c. the number after Case is the family id, so in our case Case 4: is what we will be using... before you do anything remove all of those case's, (if you wanna keep /clothes for factions, i will show you how to do that in a second tutoriall....) now add
Код:
case 4: { }
Now in the 'case' you gotta set the skins and this bit is annoying to do but its pretty simple. before we look at what we put in the 'case' search for.."new joinped" and there will be a big list of numbers this is skins, and this is where we put the grove skins..
the '52' should be how many skins are on that list (starts from 1 i THINK.. ). and you need to add your three skins to the bottom like this:
Код:
{000}, {000}, {000} // no ',' on last one
Код:
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, JoinPed[48][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = JoinPed[52][0]; } else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, JoinPed[49][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = JoinPed[53][0]; } else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, JoinPed[50][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = JoinPed[54][0]; }
[3]Setting Family Colors...
You should have a callback called... 'SetPlayerToTeamColor', if not you need to set this at the top of the script:
Код:
forward SetPlayerToTeamColor(playerid);
Код:
public SetPlayerToTeamColor(playerid) { if(IsPlayerConnected(playerid)) { } }
Код:
if(PlayerInfo[playerid][pFMember] == 4) SetPlayerColor(playerid, COLOR_PURPLE);
Код:
public SetPlayerToTeamColor(playerid) { if(IsPlayerConnected(playerid)) { SetPlayerColor(playerid,COLOR_WHITE); // white if(PlayerInfo[playerid][pFMember] == 4) SetPlayerColor(playerid, COLOR_PURPLE); } }