SA-MP Forums Archive
Script is doing wierd. - 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: Script is doing wierd. (/showthread.php?tid=611009)



Script is doing wierd. - danielpalade - 01.07.2016

I don't know why this is happening. But I have recently made a command "/giftbox" which display's the following enum.

Код:
#define MAX_BOX 1
enum boxE {
    boxID,
    boxTitle[32],
    boxStatus,
    boxVehicle,
    boxMoney,
	boxFireWorks,
	boxClearWarns,
	boxClearFP,
	boxHidden,
	boxMats,
	boxPP,
	boxTime[32],

new boxVariables[MAX_BOX][boxE];
}
This is the command.

Код:
CMD:giftbox(playerid, params[])
{
	if(playerVariables[playerid][pAdminLevel] != 6) return SCM(playerid, -1, AdminOnly);
	new string[256];
	format(string, sizeof(string), "[%s][%s][%d][%d][%d][%d][%d][%d][%d][%d][%d]", boxVariables[0][boxTime], boxVariables[0][boxTitle], boxVariables[0][boxStatus], 
	boxVariables[0][boxVehicle], boxVariables[0][boxMoney], boxVariables[0][boxFireWorks], boxVariables[0][boxClearWarns], boxVariables[0][boxClearFP], boxVariables[0][boxHidden],
	boxVariables[0][boxMats], boxVariables[0][boxPP]);
	SendClientMessage(playerid, 0xFFCFFFCFFF, string);
	return 1;
}
Nothing happened before I made this command.
The script compiles just fine, but most parts of the gamemode are not loading, event the "Mode" is saying "Unknown".
If I remove that command and restart my pc, everything works again. But after I add it again and compile it, it fucks up again. And I have to restart my pc for it to work again after I remove it. Else, it won't fix anything.

Also, I have no errors in the logs. And I have all the plugins and includes.


Re: Script is doing wierd. - Shinja - 01.07.2016

Код:
#define MAX_BOX 1
enum boxE 
{
    boxID,
    boxTitle[32],
    boxStatus,
    boxVehicle,
    boxMoney,
    boxFireWorks,
    boxClearWarns,
    boxClearFP,
    boxHidden,
    boxMats,
    boxPP,
    boxTime[32]
};

new boxVariables[MAX_BOX][boxE];
enums are usually like this, try


Re: Script is doing wierd. - danielpalade - 01.07.2016

Quote:
Originally Posted by Shinja
Посмотреть сообщение
Код:
#define MAX_BOX 1
enum boxE 
{
    boxID,
    boxTitle[32],
    boxStatus,
    boxVehicle,
    boxMoney,
    boxFireWorks,
    boxClearWarns,
    boxClearFP,
    boxHidden,
    boxMats,
    boxPP,
    boxTime[32]
};

new boxVariables[MAX_BOX][boxE];
enums are usually like this, try
Nope, not working.


Re: Script is doing wierd. - SyS - 01.07.2016

PHP код:
#define MAX_BOX 1
enum boxE 
{
    
boxID,
    
boxTitle[32],
    
boxStatus,
    
boxVehicle,
    
boxMoney,
    
boxFireWorks,
    
boxClearWarns,
    
boxClearFP,
    
boxHidden,
    
boxMats,
    
boxPP,
    
boxTime[32]
}
new 
boxVariables[MAX_BOX][boxE]; 



Re: Script is doing wierd. - Shinja - 01.07.2016

Then you aren't loading a plugin correctly, is this your first zcmd?