cmd enter problem
#1

hello take a sistem for business from tutorials ,but when i try to enter in my bizz i take this error "Server:unknown command"

Код:
CMD:enter(playerid)
{
	new h = GetClosetHouseID(playerid);
	if(House[h][On_Sell] == 0 && House[h][Lock] == 0)
	{
		SetPlayerPos(playerid,House[h][ExitX],House[h][ExitY],House[h][ExitZ]);
		SetPlayerInterior(playerid,House[h][IntID]);
		SetPlayerVirtualWorld(playerid,House[h][VW]);
	}
	else return SCM(playerid,COLOR_RED,"EROR: "COL_WHITE"House is locked/Is not on sale.");
	if(strcmp(House[h][Owner],GetName(playerid),false) == 0)
	{
		new Year, Month, Day;
		getdate(Year, Month, Day);
		House[h][DayEnter] = Day;
	 	House[h][MonthEnter] = Month;
		CheckHouse(h);
	}
 	if(IsPlayerInRangeOfPoint(playerid, 1.0, BusinessInfo[playerid][bEntranceX], BusinessInfo[playerid][bEntranceY], BusinessInfo[playerid][bEntranceZ]))//Checks if player is near the entrance.
 	{
  		if(BusinessInfo[playerid][bLocked] == 1) return SendClientMessage(playerid, COLOR_GREY, "This Business is locked!");//Checks it it is locked/
		SetPlayerPos(playerid, BusinessInfo[playerid][bExitX], BusinessInfo[playerid][bExitY], BusinessInfo[playerid][bExitZ]);
		SetPlayerFacingAngle(playerid, BusinessInfo[playerid][bExitA]);
		SetPlayerInterior(playerid, BusinessInfo[playerid][bInsideInt]);
		SetPlayerVirtualWorld(playerid, BusinessInfo[playerid][bInsideWorld]);
		InsideBiz[playerid] = playerid;
		return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, 2.0, BusinessInfo[playerid][bExitX], BusinessInfo[playerid][bExitY], BusinessInfo[playerid][bExitZ]) && GetPlayerVirtualWorld(playerid) == BusinessInfo[playerid][bInsideWorld])//Checks if player is in near the exit.
 	{
		SetPlayerPos(playerid, BusinessInfo[playerid][bEntranceX], BusinessInfo[playerid][bEntranceY], BusinessInfo[playerid][bEntranceZ]);
		SetPlayerFacingAngle(playerid, BusinessInfo[playerid][bEntranceA]);
		SetPlayerInterior(playerid, BusinessInfo[playerid][bInt]);
		SetPlayerVirtualWorld(playerid, BusinessInfo[playerid][bWorld]);
		InsideBiz[playerid] = 0;
		return 1;
	}
    return 1;
}
Reply
#2

Can u show us the console error?
Reply
#3

What if a player is not close to any house? Will GetClosetHouseID return an invalid value? Using it in House array will give run time error 4, you need to verify it is a valid house (player close to house) before doing anything.
Reply
#4

PHP код:
CMD:enter(playeridparams[]) 
Reply
#5

ZCMD's syntaxes are the following :

COMMAND:enter(playerid, params[]) or CMD:enter(playerid, params[]) // You can lowercase them (cmd/command) anyway, you should change this

PHP код:
CMD:enter(playerid
to this

PHP код:
CMD:enter(playeridparams[]) 
Beside that's not the source of the problem, no errors while compiling?
Reply
#6

i change this:
Код:
CMD:enter(playerid, params[])
but i have same problem..
Reply
#7

Is this via filterscript or you added it in your server pwn?
Reply
#8

it's Gagi's House System v1.4 and yea it's from filescript
Reply
#9

Quote:
Originally Posted by xAlecsu
Посмотреть сообщение
i change this:
Код:
CMD:enter(playerid, params[])
but i have same problem..
You can have both syntax, both will compile and work.

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
What if a player is not close to any house? Will GetClosetHouseID return an invalid value? Using it in House array will give run time error 4, you need to verify it is a valid house (player close to house) before doing anything.
^ This is the solution to your problem. You need to check if GetClosetHouseID doesn't return an invalid value, which in your case it is when you're not close to any house and your command crashes.
Reply
#10

Quote:
Originally Posted by GTLS
Посмотреть сообщение
PHP код:
CMD:enter(playeridparams[]) 
Why would that make a difference? That has nothing to do with the issue at all.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)