SA-MP Forums Archive
Some errors. - 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: Some errors. (/showthread.php?tid=378463)



Some errors. - Misterflowers - 17.09.2012

Here is the script:
Quote:

#include <a_samp>
#pragma tabsize 0

new pickup;

public OnGameModeInit()
{
pickup = CreatePickup(1240, 23, 2034.1999, -1403.1999, 18.1000, -1);
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickup)
{
ShowPlayerDialog(playerid,253,DIALOG_STYLE_MSGBOX, "Health","Buy Health ($1000)\nRocketLauncher ($8000=20 AMMO)","Select", "Close");
}
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 253)
{
if(response)
{
if(listitem == 0)
{
GivePlayerMoney(playerid, -1000);
SetPlayerHealth(playerid, 100); //Health
GameTextForPlayer(playerid, "~r~Item ~g~Purchase!", 500, 0);
}
if(listitem == 1)
{
GivePlayerMoney(playerid, -8000);
GivePlayerWeapon(playerid, 35 , 20);//rocketlaucher
GameTextForPlayer(playerid, "~r~Item ~g~Purchase!", 500, 0);
}
}
return 1;
}
return 0;
}

And this is the errors:
Quote:

error 021: symbol already defined: "OnGameModeInit"
error 021: symbol already defined: "OnPlayerPickUpPickup"
error 021: symbol already defined: "OnDialogResponse"




Re: Some errors. - TheArcher - 17.09.2012

You have OnGameModeInit, OnPlayerPickUpPickup and OnDialogResponse callbacks called 1 or more times.


Re: Some errors. - Misterflowers - 17.09.2012

w/e, what I have to do?


Re: Some errors. - mamorunl - 17.09.2012

Quote:
Originally Posted by Misterflowers
Посмотреть сообщение
w/e, what I have to do?
1) Get rid of the #pragma tabsize 0 and learn to indent your code properly
2) 'whatever' is not a proper response
3) Find the duplicate callbacks in your code and merge them. Don't send your script or paste it here, we won't do it because the code is too messy.