Help with commands
#1

Код:
if(strcmp(cmd, "/enter", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				if (IsPlayerInRangeOfPoint(playerid, 10,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
					{
					    if(PlayerInfo[playerid][pWanted] == 0)
					    {
							SafeSetPlayerInterior(playerid,HouseInfo[i][hInt]);
							SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
							SafeSetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
							GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
							PlayerInfo[playerid][pLocal] = i;
							PlayerInfo[playerid][pVirWorld] = HouseInfo[i][hWorld];
							HouseEntered[playerid] = i;
							PlayerInfo[playerid][pInteriorNr] = 39;
						}
						else
						{
							GameTextForPlayer(playerid, "~r~Criminals can't hide in houses!", 5000, 1);
							return 1;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
						return 1;
					}
				}
			}
How to do that command /enter by pressing F or Enter ? help me PLS
Reply
#2

Use something like:

if(PRESSED(KEY_SECONDARY_ATTACK))
I think F/Enter=secondary attack although, i'm not 100% sure. Check the samp wiki article to make sure.
Reply
#3

And that code goes under "OnPlayerKeyStateChange" callback.
Reply
#4

C:\Documents and Settings\Vartotojas\Desktop\ser 0.3\gamemodes\larp.pwn(43084) : error 017: undefined symbol "newkeys"

I try with

else if ((newkeys & KEY_SECONDARY_ATTACK))

help me could nybody insert a code with that command? please my insered code make pressing F or Enter
Reply
#5

Sorry for Db but help me please thats is wery important
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)