Help with commands - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with commands (
/showthread.php?tid=161935)
Help with commands -
sarioookas - 21.07.2010
Код:
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
Re: Help with commands -
John_F - 21.07.2010
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.
Re: Help with commands -
DJDhan - 21.07.2010
And that code goes under "
OnPlayerKeyStateChange" callback.
Re: Help with commands -
sarioookas - 21.07.2010
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
Re: Help with commands -
sarioookas - 21.07.2010
Sorry for Db but help me please thats is wery important