19.08.2010, 10:45
(
Последний раз редактировалось iggy1; 19.08.2010 в 11:13.
)
Ive made a house script and for some reason im getting strange results from my enter/exit commands (blank gamemode).
The problem is i enter game, use the /enter command to enter a house.
That works but ater that first /enter command- both /enter and /exit return "unknown command". I've never had this problem before and i'm quite confused
I hope someone knows whats wrong if so thanks in advance for any help heres the code.
The problem is i enter game, use the /enter command to enter a house.
That works but ater that first /enter command- both /enter and /exit return "unknown command". I've never had this problem before and i'm quite confused
I hope someone knows whats wrong if so thanks in advance for any help heres the code.
pawn Код:
COMMAND:enter(playerid,params[])
{
new str[70];
for(new h; h <= MAX_HOUSES;h++)
{
if(IsPlayerInDynamicCP(playerid,CPID[h]))
{
SetPVarInt(playerid,"cpfix",GetTickCount() + 5000);
SetPlayerPos(playerid,Hinfo[h][entposx],Hinfo[h][entposy],Hinfo[h][entposz]);
SetPlayerFacingAngle(playerid,Hinfo[h][enterang]);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,Hinfo[h][world]);
SetPlayerInterior(playerid,Hinfo[h][interior]);
format(str,sizeof(str),"~g~Welcome To ~p~%s",Hinfo[h][housename]);
GameTextForPlayer(playerid,str,5000,3);
SetPVarInt(playerid,"isinhouse",1);
SetPVarInt(playerid,"cpcheck",1);
}
}
if(GetPVarInt(playerid,"cpcheck")==0)
{
return SendClientMessage(playerid,0xff0000FF,"You Are Not at a house");
}
DeletePVar(playerid,"cpcheck");
return 1;
}
COMMAND:exit(playerid,params[])
{
if(GetPVarInt(playerid,"isinhouse")==0)return SendClientMessage(playerid,0xff0000FF,"ERROR: You are not in a house");
for(new h; h <= MAX_HOUSES;h++)
{
if(IsPlayerInDynamicCP(playerid,CPID[h]))
{
SetPVarInt(playerid,"cpfix",GetTickCount() + 5000);//to stop enter/exit cps from showing text on enter/exit.
SetPlayerPos(playerid,Hinfo[h][cpx],Hinfo[h][cpy],Hinfo[h][cpz]);
SetPlayerFacingAngle(playerid,Hinfo[h][exitang]);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid,0);
DeletePVar(playerid,"isinhouse");
}
}
return 1;
}