Command unknow
#1

Ok im pretty new to scripting and im just tring to createa /help what works fine but it still shows commad unknow under the sendclientmessage any ideas why?

CMD:help(playerid, params[])
{
SendClientMessage(playerid, COLOR_RED,"TEST");
return 0;
}

Many thanks.
Reply
#2

Your return value is false, set it to true.


PHP код:
CMD:help(playeridparams[])
SendClientMessage(playeridCOLOR_RED,"TEST"); return true; } 
Reply
#3

Brilliant work perfect.

Thought i wouldpost another question here instead of starting a new topic.

How do i remove the yellow arrows from singleplayer gta SA?
Many Thanks
Reply
#4

DisableInteriorEnterExits()

Add it under OnGameModeInit()
Reply
#5

I knew it would be something simple like that lol.

Many thanks Dimi.
Reply
#6

Ok new problem now i started on a account system and ust got stuck on saving my money i will post what i have done so far.

Problem:Money is not saving after exiting the server and you do not lose money when you die.


Код:
enum _PINFO
{
	pKills,
	pMoney,
	pDeaths,
	pLevel,
	Float:pLastX,
	Float:pLastY,
	Float:pLastZ,
	pMuted,
	pMutedReason
}


public OnPlayerDisconnect(playerid, reason)
{
    new
		CString[50];
    format(CString, sizeof(CString), "Player: %s(%d) has left the server!", pName(playerid), playerid);
    SendClientMessageToAll(COLOR_GREY, CString);

	new File[50]; format(File, sizeof(File), PFiles, pName(playerid));

	GetPlayerPos(playerid, PVar[playerid][pLastX], PVar[playerid][pLastY], PVar[playerid][pLastZ]);
	
	
	djSetInt		(File, "Kills", 	PVar[playerid][pKills]);
	djSetInt		(File, "Money", 	PVar[playerid][pMoney]);
	djSetInt		(File, "Deaths", 	PVar[playerid][pDeaths]);
	djSetInt		(File, "Level", 	PVar[playerid][pLevel]);
	djSetInt        (File, "Muted",     PVar[playerid][pMuted]);
	djSet           (File, "MutedReason", PVar[playerid][pMutedReason]);

	djSetFloat		(File, "LastX", 	PVar[playerid][pLastX]);
	djSetFloat		(File, "LastY", 	PVar[playerid][pLastY]);
	djSetFloat		(File, "LastZ", 	PVar[playerid][pLastZ]);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	PVar[killerid][pKills] += 1;
	PVar[killerid][pMoney] += -250;
	PVar[playerid][pDeaths] += 1;
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	new File[50];
	format(File, sizeof(File), PFiles, pName(playerid));
	switch(dialogid)
	{
		case LOGIN:
		{
		    if(response)
		    {
		        if(strlen(inputtext) == 0)
		        {
					new
						iStr[128];

					format(iStr, sizeof(iStr), ""#CBLUE"Welcome back: "#CDGREEN"%s(%d)\n"#CBLUE"Enter your password to login:", pName(playerid), playerid);
					return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, ""#CBLUE"Login", iStr, "Login", "Leave");
				}
    			if(strcmp(inputtext, dj(File, "Password", 40), true) == 0)
		    	{
		        	SendClientMessage(playerid, COLOR_LIGHTGREEN, "You are now logged in!");
		        
					PVar[playerid][pKills] 		= djInt		(File, "Kills");
					PVar[playerid][pMoney] 		= djInt		(File, "Money");
					PVar[playerid][pDeaths] 	= djInt		(File, "Deaths");
					PVar[playerid][pLevel] 		= djInt		(File, "Level");
					PVar[playerid][pMuted]      = djInt     (File, "Muted");
					format(PVar[playerid][pMutedReason], 52, "%s", dj(File, "MutedReason"));
					
					PVar[playerid][pLastX]      = djFloat	(File, "LastX");
					PVar[playerid][pLastY]      = djFloat	(File, "LastY");
					PVar[playerid][pLastZ]      = djFloat	(File, "LastZ");
				}
				else
				{
Any idea for tis would be great also i do not get any error or anything it complies fines.

Many Thanks.
Reply
#7

Im on my cell phone, so i cant see the whole code, but maybe you havent got getplayermoney anywhere?
Reply
#8

I thought it is something to do with that but im not sure where i need to put it. D:
Reply
#9

While player is in game don't set his money using you PVar. Use simple GivePlayerMoney. under on player disconnect just add
PHP код:
djSetInt(File,"Money",GetPlayerMoney(playerid)); 
Also check is that right function from dj File include
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)