Jump to content
Geplaatst:
comment_1623796

Ik heb zojuist een command gemaakt om huizen binnen te gaan. Hij werkt goed, maar ik krijg toch nog een SERVER: Unknown Command. Weet iemand hoe dit komt?

Hier is mijn script:

if(strcmp(cmd,"/enter",true) == 0)
{
    new hCount = 0;
    for(new h; h <= MAX_HOUSES; h++)
    {
        if(PlayerToPoint(MaxPTP,playerid,HouseInfo[h][hX],HouseInfo[h][hY],HouseInfo[h][hZ]))
        {
            hCount += 1;
            if(HouseInfo[h][hLocked] == 0 || !strcmp(pName,HouseInfo[h][hOwner],true) && IsPlayerLogged(playerid))
            {
				EnterHouse(playerid,h);
				if(strcmp(HouseInfo[h][hOwner],pName,true) == 0) format(string,sizeof(string),"SERVER: Welcome home, %s.",pName);
				else format(string,sizeof(string),"SERVER: Welcome in %s's house, %s.",HouseInfo[h][hOwner],pName);
				SendClientMessage(playerid,COLOR_ROYALBLUE,string);
			}
			else SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: This house is locked!");
		}
	}
	if(hCount == 0) SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: You aren't near any house!");
	return 1;
}

Featured Replies

Geplaatst:
comment_1623855

Ik heb zojuist een command gemaakt om huizen binnen te gaan. Hij werkt goed, maar ik krijg toch nog een SERVER: Unknown Command. Weet iemand hoe dit komt?

Hier is mijn script:

if(strcmp(cmd,"/enter",true) == 0)
{
    new hCount = 0;
    for(new h; h <= MAX_HOUSES; h++)
    {
        if(PlayerToPoint(MaxPTP,playerid,HouseInfo[h][hX],HouseInfo[h][hY],HouseInfo[h][hZ]))
        {
            hCount += 1;
            if(HouseInfo[h][hLocked] == 0 || !strcmp(pName,HouseInfo[h][hOwner],true) && IsPlayerLogged(playerid))
            {
				EnterHouse(playerid,h);
				if(strcmp(HouseInfo[h][hOwner],pName,true) == 0) format(string,sizeof(string),"SERVER: Welcome home, %s.",pName);
				else format(string,sizeof(string),"SERVER: Welcome in %s's house, %s.",HouseInfo[h][hOwner],pName);
				SendClientMessage(playerid,COLOR_ROYALBLUE,string);
			}
			else SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: This house is locked!");
		}
	}
	if(hCount == 0) SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: You aren't near any house!");
	return 1;
}

Heb je de public OnPlayerCommandText wel gesloten met return 0;?

dus:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd,"/enter",true) == 0)
{
    new hCount = 0;
    for(new h; h <= MAX_HOUSES; h++)
    {
        if(PlayerToPoint(MaxPTP,playerid,HouseInfo[h][hX],HouseInfo[h][hY],HouseInfo[h][hZ]))
        {
            hCount += 1;
            if(HouseInfo[h][hLocked] == 0 || !strcmp(pName,HouseInfo[h][hOwner],true) && IsPlayerLogged(playerid))
            {
				EnterHouse(playerid,h);
				if(strcmp(HouseInfo[h][hOwner],pName,true) == 0) format(string,sizeof(string),"SERVER: Welcome home, %s.",pName);
				else format(string,sizeof(string),"SERVER: Welcome in %s's house, %s.",HouseInfo[h][hOwner],pName);
				SendClientMessage(playerid,COLOR_ROYALBLUE,string);
			}
			else SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: This house is locked!");
		}
	}
	if(hCount == 0) SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: You aren't near any house!");
	return 1;
}
return 0;
}

Geplaatst:
  • Auteur
comment_1623866

Ik heb zojuist een command gemaakt om huizen binnen te gaan. Hij werkt goed, maar ik krijg toch nog een SERVER: Unknown Command. Weet iemand hoe dit komt?

Hier is mijn script:

if(strcmp(cmd,"/enter",true) == 0)
{
    new hCount = 0;
    for(new h; h <= MAX_HOUSES; h++)
    {
        if(PlayerToPoint(MaxPTP,playerid,HouseInfo[h][hX],HouseInfo[h][hY],HouseInfo[h][hZ]))
        {
            hCount += 1;
            if(HouseInfo[h][hLocked] == 0 || !strcmp(pName,HouseInfo[h][hOwner],true) && IsPlayerLogged(playerid))
            {
				EnterHouse(playerid,h);
				if(strcmp(HouseInfo[h][hOwner],pName,true) == 0) format(string,sizeof(string),"SERVER: Welcome home, %s.",pName);
				else format(string,sizeof(string),"SERVER: Welcome in %s's house, %s.",HouseInfo[h][hOwner],pName);
				SendClientMessage(playerid,COLOR_ROYALBLUE,string);
			}
			else SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: This house is locked!");
		}
	}
	if(hCount == 0) SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: You aren't near any house!");
	return 1;
}

Heb je de public OnPlayerCommandText wel gesloten met return 0;?

dus:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd,"/enter",true) == 0)
{
    new hCount = 0;
    for(new h; h <= MAX_HOUSES; h++)
    {
        if(PlayerToPoint(MaxPTP,playerid,HouseInfo[h][hX],HouseInfo[h][hY],HouseInfo[h][hZ]))
        {
            hCount += 1;
            if(HouseInfo[h][hLocked] == 0 || !strcmp(pName,HouseInfo[h][hOwner],true) && IsPlayerLogged(playerid))
            {
				EnterHouse(playerid,h);
				if(strcmp(HouseInfo[h][hOwner],pName,true) == 0) format(string,sizeof(string),"SERVER: Welcome home, %s.",pName);
				else format(string,sizeof(string),"SERVER: Welcome in %s's house, %s.",HouseInfo[h][hOwner],pName);
				SendClientMessage(playerid,COLOR_ROYALBLUE,string);
			}
			else SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: This house is locked!");
		}
	}
	if(hCount == 0) SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: You aren't near any house!");
	return 1;
}
return 0;
}

Jep. Ik had hetzelfde probleem met mijn /admins command. Dat heb ik wel verholpen, ik kijk daar anders ook wel even naar.

Een reactie plaatsen

Je kan nu een reactie plaatsen en pas achteraf registreren. Als je al lid bent, log eerst in om met je eigen account een reactie te plaatsen.

Gast
Op dit onderwerp reageren...

Recent actief 0

  • Er zijn hier geen geregistreerde gebruikers aanwezig.