Tutorial] Cum sa adaugi o fanctiune noua
Mai intai dai search(ctrl+f) si cauti "case 11".
Te duci la ultima varianta de cautare.
Uite cum arata:
CODE
case 11: //Driving/Flying School
{
if(SelectCharPlace[playerid] == 1) { SetPlayerSkin(playerid, JoinPed[48][0]); SelectCharPlace[playerid] = 2; ChosenSkin[playerid] = JoinPed[48][0]; }
else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, JoinPed[49][0]); SelectCharPlace[playerid] = 3; ChosenSkin[playerid] = JoinPed[49][0]; }
else if(SelectCharPlace[playerid] == 3) { SetPlayerSkin(playerid, JoinPed[50][0]); SelectCharPlace[playerid] = 4; ChosenSkin[playerid] = JoinPed[50][0]; }
else if(SelectCharPlace[playerid] == 4) { SetPlayerSkin(playerid, JoinPed[51][0]); SelectCharPlace[playerid] = 1; ChosenSkin[playerid] = JoinPed[51][0]; }
}
O dublezi pe asta, si in loc de "//Driving/Flying School" scrii "//FactiuneMeaNoua".
Si in loc de 11 pui 12.
Acum sa setam spawnul.
Dai search(ctrl+f) si cauta "if (PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10) //Taxi Cab Company spawn"
Pe aceasta o dublezi si in loc de "//Taxi Cab Company spawn" scrii "//FactiuneaMeaNoua".
Acum te duci pe server si alegi un loc pentru spawnul factiunii, si dai /save.
D>Jocuri>GtaSanAndreas>savedpositions.txt
Acum copiezi X,Y,Z(ce ai tu acolo)
Se poate citi dupa virgule. Exemplu: 123, - modelid
456 - X
789 - Y
123 - Z
Si asa mai departe.Sa continuam:
CODE
AddPlayerClass(modelid, X, Y, Z, angle, weapon1, weapon1, ammo)
Acum dublezi
CODE
else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11) { ttext = "School Instructor"; }
si in locul lui 11 pui 12, si in locul lui "School Instructor" pui "Membru Al Factiunii Noi" .
Acum dai mai jos pana gasesti "else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11)
{ ftext = "License Faction"; }"
O dublezi, in loc de 11 pui 12, "License Faction" il schimbi in "Factiune Noua".
Acum sa punem rankurile.
Dati mai jos pana ce gasiti:
"else if(PlayerInfo[targetid][pMember] == 10 || PlayerInfo[targetid][pLeader] == 10)//SAPT Ranks
{
if(PlayerInfo[targetid][pRank] == 1) { rtext = "Trainee"; }
else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Rookie"; }
else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Cabbie"; }
else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Dispatcher"; }
else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Shift Supervisor"; }
else if(PlayerInfo[targetid][pRank] == 6) { rtext = "SAPT Commissioner"; }
else { rtext = "Trainee"; }
}
"
O dublezi si in loc de 10 pui 12 si in loc de "//SAPT Ranks" pui "//Ranks factiune noua".
Acum sa punem si skinul liderului.
Dai search(ctrl+f) si cauti "/makeleader".
Vei gasi asta:
CODE
if(strcmp(cmd, "/makeleader", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeleader [playerid/PartOfName] [Number(1-13)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
... ETC.
Daca dati scroll mai in jos veti gasi asa:
CODE
if(level > 12 || level < 0) { SendClientMessage(playerid, COLOR_GREY, " Dont go below number 0, or above number 13!"); return 1; }
Din 12, modifici in 13
CODE
if(level > 13 || level < 0) { SendClientMessage(playerid, COLOR_GREY, " Dont go below number 0, or above number 13!"); return 1; }
Acum dati mai in jos pana ce gasiti "else if(level == 11) { PlayerInfo[para1][pChar] = 171; } //Driving/Flying School"
O dublati, in loc de 11 puneti 12, si in loc de "//Driving/Flying School" pui "//FactiuneNoua".
Acum intri pe un site de skinuri SAMP cu poze si in loc de 171 pui numarul skinului dorit.
Acum du-te la comanda "/invite".(ctrl+f si cauta "/invite" cu ghilimele!)
Dupa linia:
CODE
else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "School Instructors"; ChosenSkin[para1] = 59; SetPlayerSkin(para1, 59); }