12.05.2014, 18:31
as I press the right button, I get the message "non stai guidando un veicolo"
And if I replace
with
when I press the right button of the mouse out of a vehicle, it tells me "Name_Surname gira la chiave e accende il motore del veicolo"
About the gametext ...
I would like to make is that once a player is on top of a pickup icon, appeared to him a gametext. I tried to put the gametext under onplayerconnect ... don't work.
I also set the range ... but no, it does not work.
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_HANDBRAKE))
{
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Non hai effettuato il log-in.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "Non stai guidando un veicolo.");
if(vehicleid == 509 || vehicleid == 481 || vehicleid == 510) return SendClientMessage(playerid, COLOR_GREY, "Bicycles have no engine.");
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(!engine)
{
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh])
{SetVehicleParamsEx(vehicleid, 1, lights, alarm, PlayerInfo[playerid][vLocked], bonnet, boot, objective);}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVeh])
{SetVehicleParamsEx(vehicleid, 1, lights, alarm, PlayerInfo[playerid][vVLocked], bonnet, boot, objective);}
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVVeh])
{SetVehicleParamsEx(vehicleid, 1, lights, alarm, PlayerInfo[playerid][vVVLocked], bonnet, boot, objective);}
format(string, sizeof(string), "* %s gira la chiave ed accende il motore del veicolo.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}
if (PRESSED (KEY_FIRE))
{
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh])
{SetVehicleParamsEx(vehicleid, 0, lights, alarm, PlayerInfo[playerid][vLocked], bonnet, boot, objective);}
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVeh])
{SetVehicleParamsEx(vehicleid, 0, lights, alarm, PlayerInfo[playerid][vVLocked], bonnet, boot, objective);}
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVVeh])
{SetVehicleParamsEx(vehicleid, 0, lights, alarm, PlayerInfo[playerid][vVVLocked], bonnet, boot, objective);}
format(string, sizeof(string), "* %s gira la chiave e spegne il motore del veicolo.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}
}
PHP код:
"if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "Non stai guidando un veicolo.");"
PHP код:
"if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
About the gametext ...
I would like to make is that once a player is on top of a pickup icon, appeared to him a gametext. I tried to put the gametext under onplayerconnect ... don't work.
I also set the range ... but no, it does not work.
PHP код:
public OnPlayerConnect(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 1.5, 1247.6791,-1559.9728,13.5555))
{
GameTextForPlayer(playerid, "Digita ~r~ /esame~w~ per una lista delle license acquistabili.", 5000, 5);
}