SA-MP Forums Archive
OnDialogResponse - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnDialogResponse (/showthread.php?tid=584142)



OnDialogResponse - Dragonic - 02.08.2015

When I try to put another dialog response, I get those error lines:

Quote:

C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1616) : error 029: invalid expression, assumed zero
C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1616) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1643) : warning 225: unreachable code
C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1643) : error 029: invalid expression, assumed zero
C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1643) : error 004: function "OnPlayerKeyStateChange" is not implemented
C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1645) : error 001: expected token: ";", but found "if"
C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1645) : error 017: undefined symbol "newkeys"
C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1655) : error 017: undefined symbol "newkeys"
C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1667) : error 017: undefined symbol "newkeys"
C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1682) : error 017: undefined symbol "newkeys"
C:\Users\Dragonic\Desktop\SA-MP\gamemodes\DR-CITY-GAMEMODE.pwn(1704) : warning 209: function "OnDialogResponse" should return a value

The problem is that those lines don't have any errors, this happens when I add the seccond dialog responde:

Quote:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_CITIES)
{
if(response)
{
if(listitem == 1) {
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[TELE] %s went to Liberty City. (/LS)", pname);
SendClientMessageToAll(0xFFFF00AA, string);
GameTextForPlayer(playerid,"LIBERTY CITY",4500,6);
SetPlayerPos(playerid,-750.50,491.00,1371.70);
SetPlayerInterior(playerid,1);
DisablePlayerRaceCheckpoint(playerid);
IsPlayerInAnyVehicle(playerid);
{
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid,-750.50,491.00,1371.70);
PutPlayerInVehicle(playerid, vehicleid, 0);
}
} else if(listitem == 2) {
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[TELE] %s went to Los Santos. (/LS)", pname);
SendClientMessageToAll(0xFFFF00AA, string);
GameTextForPlayer(playerid,"LOS SANTOS",4500,6);
SetPlayerPos(playerid,1542,-1675,14);
SetPlayerInterior(playerid,0);
DisablePlayerRaceCheckpoint(playerid);
IsPlayerInAnyVehicle(playerid);
{
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid,1542,-1675,14);
PutPlayerInVehicle(playerid, vehicleid, 0);
}
}
}
if(dialogid == DIALOG_WEAPONS)
{
if(response)
{
if(listitem == 1) {
if(GetPlayerMoney(playerid) < 750) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] Not enought money!");
GivePlayerMoney(playerid, -750);
GivePlayerWeapon(playerid,31,200);
SendClientMessage(playerid,0x33CCFFAA,">> Here's your M4!");
} else if(listitem == 2) {
if(GetPlayerMoney(playerid) < 650) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] Not enought money!");
GivePlayerMoney(playerid, -650);
GivePlayerWeapon(playerid,30,200);
SendClientMessage(playerid,0x33CCFFAA,">> Here's your AK-47!");
}
}
return 1;
}

return 0;
}




Re: OnDialogResponse - Lajko1 - 02.08.2015

It's easier if you mark the error lines


Re: OnDialogResponse - Dragonic - 02.08.2015

Nvm I already fixed it, I was just missing a few "}" lines