Jump to content
  • 0

comanda simpla


K0hL

Question

17 answers to this question

Recommended Posts

  • 0

ai comanda ta (CMD:comanda playerid paramterii), pui eventual dacă ești pe s4urik/bigzone sau orice altceva variabila cu isplayerconnected sau logged, asta doar ca să nu fie o problemă, pui lafel de frumos isplayerinrangeofpoint(playerid, coordonate1, 2, 3); și mai pui un sendclientmessage dacă nu în zona aproape de tine, ca să îi dea un scm că nu e aproape și să pui un SetPlayerCheckpoint(playerid, coordonate,mărime), cam atât ai de făcut.

Link to comment
Share on other sites

  • 0

    CMD:wherebonus(playerid, params[])
    {
        if(!IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z)) return SendClientMessage(playerid, COLOR_GREY, "Nu esti la locatia potrivita. Ti-am pus in checkpoint pe harta.");
        SetPlayerCheckpoint(playerid, x, y, z, 3.0);
        return 1;
    }

Link to comment
Share on other sites

  • 0
//Daca nu ai definit CP[playerid]
/*
new CP[MAX_PLAYERS];
*/
CMD:whereisbonus(playerid, params[]) {
	if(CP[playerid] != 0) return SendClientMessage(playerid, -1, "Ai deja un checkpoint activ.");
    SetPlayerCheckpoint(playerid, x, y, z, 5.0);
    CP[playerid] = 1;
	return 1;
}
CMD:wib(playerid, params[]) return cmd_whereisbonus(playerid, params);
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  	switch(CP[playerid]) {
      	case 1: {
          	SendClientMessage(playerid, -1, "Ai ajuns la checkpoint.");
          	DisablePlayerCheckpoint(playerid);
        }
    }
  	return 1;
}
public OnPlayerConnect(playerid)
{
  	CP[playerid] = 0;
	return 1;
}

 

  • Like 1

maxresdefault.jpg

 

 

 

Link to comment
Share on other sites

  • 0
3 minutes ago, ASGOOD said:

//Daca nu ai definit CP[playerid]
/*
new CP[MAX_PLAYERS];
*/
CMD:whereisbonus(playerid, params[]) {
	if(CP[playerid] != 0) return SendClientMessage(playerid, -1, "Ai deja un checkpoint activ.");
    SetPlayerCheckpoint(playerid, x, y, z, 5.0);
    CP[playerid] = 1;
	return 1;
}
CMD:wib(playerid, params[]) return cmd_whereisbonus(playerid, params);
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  	switch(CP[playerid]) {
      	case 1: {
          	SendClientMessage(playerid, -1, "Ai ajuns la checkpoint.");
          	DisablePlayerCheckpoint(playerid);
        }
    }
  	return 1;
}
public OnPlayerConnect(playerid)
{
  	CP[playerid] = 0;
	return 1;
}

 

ce face /wib, la ce ma ajuta ?

Link to comment
Share on other sites

  • 0
3 hours ago, ASGOOD said:

//Daca nu ai definit CP[playerid]
/*
new CP[MAX_PLAYERS];
*/
CMD:whereisbonus(playerid, params[]) {
	if(CP[playerid] != 0) return SendClientMessage(playerid, -1, "Ai deja un checkpoint activ.");
    SetPlayerCheckpoint(playerid, x, y, z, 5.0);
    CP[playerid] = 1;
	return 1;
}
CMD:wib(playerid, params[]) return cmd_whereisbonus(playerid, params);
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  	switch(CP[playerid]) {
      	case 1: {
          	SendClientMessage(playerid, -1, "Ai ajuns la checkpoint.");
          	DisablePlayerCheckpoint(playerid);
        }
    }
  	return 1;
}
public OnPlayerConnect(playerid)
{
  	CP[playerid] = 0;
	return 1;
}

 

OnDialogResponse?

 

Verificarile alea le faci la OnPlayerEnterCheckpoint.

Link to comment
Share on other sites

  • 0
YCMD:wherebonus(playerid, params[], help) {
	new randomblablabal = random(3)+1;
	switch(randomblablabal) {
		case 1: SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
		case 2:	SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
		case 3:	SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
		case 4:	SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
	}
	return true; }

 

Edited by MiritaXD
Link to comment
Share on other sites

  • 0
Acum 6 ore, MiritaXD a spus:

YCMD:wherebonus(playerid, params[], help) {
	new randomblablabal = random(3)+1;
	switch(randomblablabal) {
		case 1: SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
		case 2:	SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
		case 3:	SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
		case 4:	SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
	}
	return true; }

 

Metode antice .. :))

Link to comment
Share on other sites

  • 0
Acum 16 minute, valivaly96 a spus:

Pune un exemplu de metode "moderne" mister

Ia mister

	new Float: WhereBonusPos[4][3] = {
    {934.1129,-1393.1243,12.9426},
    {915.2028,-1418.5118,12.9239},
    {914.7075,-1476.2834,13.0913},
    {915.0554,-1561.2878,13.0826}};
CMD:wherebonus(playerid,params[]) {
    new 
        randwhere = random(sizeof(WhereBonusPos)); 
    SetPlayerCheckpoint(playerid, WhereBonusPos[randwhere][0],WhereBonusPos[randwhere][1],WhereBonusPos[randwhere][2], 5.0);
    return 1;
}
	

Eu as vedea codu' asta mai ok decat ala .. :)

Link to comment
Share on other sites

  • 0
Acum 9 ore, K0hL a spus:

si cum fac cand intra in el sa il dezactivezE?

cmd:numecomanda(playerid,params[])

{

SetPlayerCheckpoint(x,y,z,raza);//x,y,z le iei cu /save din joc sau map editor

CP[playerid]=12345;//daca nu ai definita variabila CP o definesti asa dupa includeuri: new CP[MAX_PLAYERS]

//Variabila cp o folosim ca sa verificam la callbaclul onplayerentercheckpoint daca acest checpoint este activ

return 1;

}

La onplayerentercheckpoint faci asa

if(CP[playerid]==12345) {

DisablePlayerCheckpoint(playerid);

CP[playerid]=0;

}

Edited by valivaly96
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.