Jump to content
  • 0

Problema creare job


Tudo

Question

Salut, incerc sa fac un job truck mai simplu si am nevoie de putin ajutor cu cateva chestii pe care nu le stiu.

Acesta este scriptul:

if(strcmp(cmd, "/truck", true) == 0)
		{
		    new vehicleid = GetPlayerVehicleID(playerid);
		    if(vehicleid == truck[0] || vehicleid == truck[1] ||vehicleid == truck[1])
		    {
		        truckCP[playerid] = 1;
		        DisablePlayerCheckpoint(playerid);
				new rand = random(sizeof(RandomCP));
    			SetPlayerCheckpoint(playerid, RandomCP[rand][0], RandomCP[rand][1],RandomCP[rand][2], 5.0);
			}
				else
                {
               SendClientMessage(playerid,COLOR_GREY,"Nu esti intr-un TIR .");
             }
            }

Ce am nevoie, pai, 

1. Cand playerul respectiv scrie prima oara /truck ii apare un checkpoint unde trebuie sa se duca, insa aici vreau ca playerul sa nu poata sa scrie iar /truck si sa-i schimbe checkpoint-ul, vreau mai intai sa se duca la checkpoint-ul care i l-a dat prima oara iar apoi sa poata scrie iar pentru al doilea CP .

2.Vreau ca acel player sa nu poata sa scrie /truck daca nu a atasat la TIR o remorca (aici chiar nu imi dau seama ce script sa folosesc, nici exemplu nu am gasit)

3. Multumesc de ajutor . :)

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
49 minutes ago, Tudo said:

Salut, incerc sa fac un job truck mai simplu si am nevoie de putin ajutor cu cateva chestii pe care nu le stiu.

Acesta este scriptul:


if(strcmp(cmd, "/truck", true) == 0)
		{
		    new vehicleid = GetPlayerVehicleID(playerid);
		    if(vehicleid == truck[0] || vehicleid == truck[1] ||vehicleid == truck[1])
		    {
		        truckCP[playerid] = 1;
		        DisablePlayerCheckpoint(playerid);
				new rand = random(sizeof(RandomCP));
    			SetPlayerCheckpoint(playerid, RandomCP[rand][0], RandomCP[rand][1],RandomCP[rand][2], 5.0);
			}
				else
                {
               SendClientMessage(playerid,COLOR_GREY,"Nu esti intr-un TIR .");
             }
            }

Ce am nevoie, pai, 

1. Cand playerul respectiv scrie prima oara /truck ii apare un checkpoint unde trebuie sa se duca, insa aici vreau ca playerul sa nu poata sa scrie iar /truck si sa-i schimbe checkpoint-ul, vreau mai intai sa se duca la checkpoint-ul care i l-a dat prima oara iar apoi sa poata scrie iar pentru al doilea CP .

2.Vreau ca acel player sa nu poata sa scrie /truck daca nu a atasat la TIR o remorca (aici chiar nu imi dau seama ce script sa folosesc, nici exemplu nu am gasit)

3. Multumesc de ajutor . :)

faci o variabila new Working[MAX_PLAYERS];

si pui acolo if(Working[playerid] == 0)

Working[playerid] = 1; si pui restul.

iar pentru Trailler 

IsTraillerAttachedToVehicle

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0

La inceputul gm-ul
New PlayerWork [MAX_PLAYERS]
//o poti folosi pt toate joburile nu trebuie sa mai faci altele




if(strcmp(cmd, "/truck", true) == 0) { new vehicleid = GetPlayerVehicleID(playerid); if(vehicleid == truck[0] || vehicleid == truck[1] ||vehicleid == truck[1]) {
if (PlayerWork [playerid]!=0)return SendClientMessage (playerid,-1,"muncesti deja");
If (!IsTrailerAttachedToVehicle(vehicleid)) return SCM (playerid,-1,"Nu ai remorca atasata");
PlayerWork[playerid]=1
 truckCP[playerid] = 1; DisablePlayerCheckpoint(playerid); new rand = random(sizeof(RandomCP)); SetPlayerCheckpoint(playerid, RandomCP[rand][0], RandomCP[rand][1],RandomCP[rand][2], 5.0); } else { SendClientMessage(playerid,COLOR_GREY,"Nu esti intr-un TIR ."); } }


Si la onplayerenterchecpoint faci iara verificarea sa vezi daca are atasata remorca. Cva de genu
If (!IsTrailerAttachedToVehicle(vehicleid)) return SCM (playerid,-1,"Nu ai remorca atasata prin urmare nu vei fii platit");
GivePlayerMoney (playerid,bani);//linia asta se va executa doar daca are remorca
//pui pe 0 playerwork
PlayerWork [playerid]=0;
TruckCP [playerid]=0;

  • Upvote 1
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
Answer this question...

×   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.