YCMD:empezarrecorrido(playerid, params[], help)
{
if (help) SendClientMessage(playerid, 0xFF0000AA, "Puedes comprar en la barra."); // Esto no sale si se usa el comando
else
{
if(!IsPlayerInAnyVehicle(playerid)) return Message(playerid, COLOR_GRAD2, "No estбs en un vehнculo!");
SetPlayerCheckpoint(playerid, pos, pos, pos, 15.0);
return 1;
}
return 1;
}
stock HayDos(vehicleid)
{
new count = 0;
for(new i = 0; i < GetMaxPlayers(); i++)
if(IsPlayerInVehicle(i, vehicleid))
count++;
if(count > 2) return 1;
else return 0;
}
pawn Код:
|
YCMD:empezarrecorrido(playerid, params[], help)
{
if (help) SendClientMessage(playerid, 0xFF0000AA, "Puedes comprar en la barra."); // Esto no sale si se usa el comando
else
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) return Message(playerid, COLOR_GRAD2, "No estбs en un vehнculo!");
if(HayDos(vehicleid)) return Message(playerid, COLOR_GRAD2, "Tienen que ser dos para el recorrido!.");
//SetPlayerCheckpoint(playerid, pos, pos, pos, 15.0);
new enginem, lights, alarm, doors, bonnet, boot, objective;//define las cosas del auto
GetVehicleParamsEx(GetPlayerVehicleID(playerid),enginem, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, COLOR_WHITE, "Son dos en el coche.");
return 1;
}
return 1;
}
YCMD:empezarrecorrido(playerid, params[], help)
{
if (help) SendClientMessage(playerid, 0xFF0000AA, "Puedes comprar en la barra."); // Esto no sale si se usa el comando
else
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) return Message(playerid, COLOR_GRAD2, "No estбs en un vehнculo!");
if(!HayDos(vehicleid)) return Message(playerid, COLOR_GRAD2, "Tienen que ser dos para el recorrido!.");
//SetPlayerCheckpoint(playerid, pos, pos, pos, 15.0);
new enginem, lights, alarm, doors, bonnet, boot, objective;//define las cosas del auto
GetVehicleParamsEx(GetPlayerVehicleID(playerid),enginem, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, COLOR_WHITE, "Son dos en el coche.");
return 1;
}
return 1;
}
stock HayDos(vehicleid)
{
new count = 0;
for(new i = 0; i < GetMaxPlayers(); i++)
if(IsPlayerInVehicle(i, vehicleid))
count++;
if(count > 1) return 1;//Aqui puse dos envez de uno.
else return 0;
}
stock HayDos(vehicleid, playerid)
{
for(new i = 0; i < GetMaxPlayers(); i++)
if(IsPlayerInVehicle(i, vehicleid))
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetPlayerState(i) == PLAYER_STATE_PASSENGER) return 1;
else return 0;
}