Jump to content

Cum Creem o factiune noua in gamemodul nostru!


KingZone

Recommended Posts

Salut prietenii bun gasit la un nou tutorial sa-mp scripting! Am vazut ca multi cautati, cum sa faceti o factiune noua asa ca mam gandit sa fac un tutorial ca sa nu va mai rupeti atat capul... In tutorialul de mai jos vad ca nu pre-a ati inteles nimic asa ca sa-i dam drumu! :grin:

1.Mai intai dai search(ctrl+f) si cauti:
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

2.Acum sa setam spawnul.
Dai search(ctrl+f) si cauta.
Code
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
3. Acum cautati:
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"

4. Acum dai mai jos pana gasesti
Code
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".

5. Acum sa punem rankurile dati mai jos pana ce gasiti:

Code
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".
6.Acum sa punem si skinul liderului.
Dai search(ctrl+f) si cauti "/makeleader".
Si vei gasi asta:
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.
Si va arata asa:
Code
if(level > 13 || level < 0) { SendClientMessage(playerid, COLOR_GREY, " Dont go below number 0, or above number 13!"); return 1; }

7.Acum dati mai jos pana ce gasiti:
Code
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 iti alegi un skin si il pui in loc de 171 pui skinu dorit.

8.Acum du-te la comanda "/invite".(ctrl+f si cauta "/invite" cu ghilimele!)
Si vei gasi ceva de genu:
Code
else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "School Instructors"; ChosenSkin[para1] = 59; SetPlayerSkin(para1, 59); }

O dublezi si in loc de 11 pui 12!

9. Acum sa adaugam masinile!
La inceputul gm-ului adaugi
new oricenume1;
new oricenume2; (depinde in cate masini ai da /save, daca dai in 5 masini, scri de 5 ori new oricenume3,4,5 etc)

Te duci pe server alegi masinile si pozitia lor intri in ele si dai /save.
Dupa ce ai dat la toate /save iesi de pe server, te duci in my documents/GTA San Andreas User Files/samp/savedpositions.
Copiezi masinile de acolo si le bagi ultimile, la linia
Code
public OnGameModeInit()
{
cu ce nume ai pus tu la new origenume1; in fata acesteia dar fara new.
Un exemplu:
Code
    oricenume1 = AddStaticVehicle(486,-711.8731,941.2867,12.5849,91.0978,1,1); //NumeFactiune
  oricenume2 = AddStaticVehicle(571,-666.4409,941.3121,11.4163,275.8027,1,1); //NumeFactiune
  oricenume3 = AddStaticVehicle(571,-666.1060,938.0422,11.4166,266.5053,1,1); //NumeFactiune

  • Upvote 1
Link to comment
Share on other sites

  • 1 month later...

Vreau sa fiu sincer cu tine, e bine dar se putea si mai bine. In primul rand ai avut multe greseli la gramatica si in al doilea rand dam degeaba  " CTRL + F" ca daca avem un gamemode gol, ce facem? Puteai explica mult mai bine..

1/3

// Desenul meu animat 
// Alte episoade aici: 
https://www.youtube.com/channel/UCF2kY1CzhHI_PCyV5LprQ1w/videos

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.