18.03.2019, 22:51
Sorry for my bad English
Well, a few months ago I downloaded a RP base game mode to make a server, and I was doing the work. Everything is fine, I watched many tutorials and they helped me a lot. The problem is that when the player joins the job and places / rutabus (since it's a bus driver job), it just gives a route, which I did in the script. What I am looking for is to be able to make more routes, and that when the player places / rutabus, I give him one at random. Here my code
COMMAND:
My other route ...
Returning to the question, how can I do when the player writes / rutabus assign one of the two routes?
I read what can be done with the dialogues, but my idea is not that the player chooses, but that it is aeleatoriamente. Thanks for your help beforehand
Well, a few months ago I downloaded a RP base game mode to make a server, and I was doing the work. Everything is fine, I watched many tutorials and they helped me a lot. The problem is that when the player joins the job and places / rutabus (since it's a bus driver job), it just gives a route, which I did in the script. What I am looking for is to be able to make more routes, and that when the player places / rutabus, I give him one at random. Here my code
COMMAND:
PHP код:
COMMAND:rutabus(playerid, cmdtext)
{
if (!IsPlayerInRangeOfPoint(playerid, 5.0, 2011.9757,-2099.0300,13.5469))
{
return SendClientMessage(playerid, 0xFF0000FF, "No estas cerca de el trabajo de chofer de larga distancia");
}
micrerobb[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
SetPlayerCheckpoint(playerid, 2013.0076,-2061.3867,13.2737, 10.0); // This creates a checkpoint at the co?rdinates: "-269.1287,2610.6057,63.2069"
SendClientMessage(playerid, 0xFFFF00AA, "Iniciaste la ruta de chofer de larga distancia");
SendClientMessage(playerid, 0xFFFF00AA, "La ruta de hoy es Los Santos - BlueBerry");
SendClientMessage(playerid, 0xFFFF00AA, "¡Ve a un bus y segui los checkpoints!");
return 1;
}
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
if(micrerobb[playerid] == 1){
micrerobb[playerid] = 2;
SetPlayerCheckpoint(playerid,1495.5216,-1588.7761,13.1099,5);
SendClientMessage(playerid, 0xFFFF00AA, "Los pasajeros ya subieron, ahora tenes que ir a la parada intermedia!");
return 1;
}
if(micrerobb[playerid] == 2){
micrerobb[playerid] = 3;
SetPlayerCheckpoint(playerid,317.6990,-17.8283,1.3052,5);
SetTimerEx("pasajeros subiendo...", 5000, 0, "i", playerid);
SendClientMessage(playerid, 0xFFFF00AA, "¡Los pasajeros ya subieron!, ahora si, ve a la terminal de buses de BlueBerry");
return 1;
}
if(micrerobb[playerid] == 3){
micrerobb[playerid] = 4;
SetPlayerCheckpoint(playerid,310.9017,-18.0067,1.3056,5);
SendClientMessage(playerid, 0xFFFF00AA, "¡Bien hecho!, ahora tenemos que volver a Los Santos, ve al checkpoint");
return 1;
}
if(micrerobb[playerid] == 4){
micrerobb[playerid] = 5;
SetPlayerCheckpoint(playerid,1601.3608,-1735.8271,13.1099,10);
SendClientMessage(playerid, 0xFFFF00AA, "¡Los pasajeros ya subieron!, ahora si, vayamos a la parada intermedia");
return 1;
}
if(micrerobb[playerid] == 5){
micrerobb[playerid] = 6;
SetPlayerCheckpoint(playerid,2028.4951,-2061.6758,13.2740,10);
SendClientMessage(playerid, 0xFFFF00AA, "¡Bien hecho! Ahora vayamos a la terminal central de buses Los Santos");
return 1;
}
if(micrerobb[playerid] == 6){
micrerobb[playerid] = 0;
SendClientMessage(playerid, 0xFFFF00AA, "Bien hecho, espera que los pasajeros bajen");
SendClientMessage(playerid, 0xFFFF00AA, "Felicidades!. Completaste la ruta correctamente. Recibiste $3000");
GivePlayerMoney(playerid, 3000);
DisablePlayerCheckpoint(playerid);
return 1;
}
}
return 1;
}
PHP код:
}
if(micrerobb2[playerid] == 1){
micrerobb2[playerid] = 2;
SetPlayerCheckpoint(playerid,1495.5216,-1588.7761,13.1099,5);
SendClientMessage(playerid, 0xFFFF00AA, "Los pasajeros ya subieron, ahora tenes que ir a la parada intermedia!");
return 1;
}
if(micrerobb2[playerid] == 2){
micrerobb2[playerid] = 3;
SetPlayerCheckpoint(playerid,317.6990,-17.8283,1.3052,5);
SetTimerEx("pasajeros subiendo...", 5000, 0, "i", playerid);
SendClientMessage(playerid, 0xFFFF00AA, "¡Los pasajeros ya subieron!, ahora si, ve a la terminal de buses de San Fierro");
return 1;
}
if(micrerobb2[playerid] == 3){
micrerobb2[playerid] = 4;
SetPlayerCheckpoint(playerid,-235.1712,-2943.3865,-0.6991,5);
SendClientMessage(playerid, 0xFFFF00AA, "¡Bien hecho!, ahora tenemos que volver a Los Santos, ve al checkpoint");
return 1;
}
if(micrerobb2[playerid] == 4){
micrerobb2[playerid] = 5;
SetPlayerCheckpoint(playerid,1601.3608,-1735.8271,13.1099,10);
SendClientMessage(playerid, 0xFFFF00AA, "¡Los pasajeros ya subieron!, ahora si, vayamos a la parada intermedia");
return 1;
}
if(micrerobb2[playerid] == 5){
micrerobb2[playerid] = 6;
SetPlayerCheckpoint(playerid,2028.4951,-2061.6758,13.2740,10);
SendClientMessage(playerid, 0xFFFF00AA, "¡Bien hecho! Ahora vayamos a la terminal central de buses Los Santos");
return 1;
}
if(micrerobb2[playerid] == 6){
micrerobb2[playerid] = 0;
SendClientMessage(playerid, 0xFFFF00AA, "Bien hecho, espera que los pasajeros bajen");
SendClientMessage(playerid, 0xFFFF00AA, "Felicidades!. Completaste la ruta correctamente. Recibiste $3000");
GivePlayerMoney(playerid, 3000);
DisablePlayerCheckpoint(playerid);
return 1;
}
}
return 1;
}
I read what can be done with the dialogues, but my idea is not that the player chooses, but that it is aeleatoriamente. Thanks for your help beforehand