Skripta:LG
Detaljan opis problema:Kako da stavim ovu komandu u dialog
if(!strcmp(cmd, "/upali", true))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(gEngine[playerid] == 1) { return 1; }
new playerveh = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(playerid, playerveh, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s gura kljuc u bravu i pokusava upaliti vozilo.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
GameTextForPlayer(playerid, "~y~pokretanje vozila...",3500,3);
gEngine[playerid] = 1;
return 1;
}
if(engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAPlane(idcar))
{
return 1;
}
engineOn[GetPlayerVehicleID(playerid)] = false;
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s gasi motor vozila.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
gEngine[playerid] = 0;
return 1;
}
}
}
return 1;
}
Dio skripte:Komanda
Slike://///
Sta ce ti obicna komanda u dijalogu? Trebao bi napraviti komandu recimo /motor pa da na listi u dijalogu dobijes Upali motor i Ugasi motor.
Po meni je to totalno bespotrebno, jedino kad bi sve komande vezane za vozilo ubacio u dijalog pa da ti to bude jedna od opcija.
vako
if(!strcmp(cmd, "/upali", true))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
ShowPlayerDialog(playerid, 9898, DIALOG_STYLE_LIST, "Vozilo", "Upali\nUgasi", "Ok", "Izadi");
}
return 1;
}
u OnDialogResponse
if(dialgoid == 9898)
{
if(response)
{
if(listitem == 0)
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(gEngine[playerid] == 1) { return 1; }
new playerveh = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(playerid, playerveh, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s gura kljuc u bravu i pokusava upaliti vozilo.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
GameTextForPlayer(playerid, "~y~pokretanje vozila...",3500,3);
gEngine[playerid] = 1;
}
if(listitem == 1)
{
engineOn[GetPlayerVehicleID(playerid)] = false;
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s gasi motor vozila.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
gEngine[playerid] = 0;
}
}
}
Sa tvojom komandom nece moci ugasiti auto. Tu provjeru jel vozilo upaljeno treba staviti dolje u dialogresponse...
zajebao sam se, eto edit
OK,Moicu moderatora da stavi LOCK OVDJEN