public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buylaser", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(waffenmenu,playerid);
TogglePlayerControllable(playerid,0);
return 1;
}
|
How can I make a command only available at the ammunation?
I want Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buylaser", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(waffenmenu,playerid);
TogglePlayerControllable(playerid,0);
return 1;
}
|
//Something like , might work. Just an example :P
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buylaser", cmdtext, true, 10) == 0)
{ if(IsPlayerInRangeOfPoint(playerid,range,x,y,z) || GetPlayerInterior(playerid,ammuinteriorid)) //Replace
{
ShowMenuForPlayer(waffenmenu,playerid);
TogglePlayerControllable(playerid,0);
}
return 1;
}

C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(43) : error 001: expected token: ")", but found ";" C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(43) : error 036: empty statement C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(43) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(43) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
{ if(IsPlayerInRangeOfPoint(playerid,10,292.5413,-34.4905,1001.5156); || GetPlayerInterior(playerid,1))

|
Testing now thanks
![]() EDIT2 :: Код:
C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(43) : error 001: expected token: ")", but found ";" C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(43) : error 036: empty statement C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(43) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(43) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. Код:
{ if(IsPlayerInRangeOfPoint(playerid,10,292.5413,-34.4905,1001.5156); || GetPlayerInterior(playerid,1))
|
if(IsPlayerInRangeOfPoint(playerid,10,292.5413,-34.4905,1001.5156) || GetPlayerInterior(playerid,1))
|
pawn Код:
|
C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(43) : warning 202: number of arguments does not match definition C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(52) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(52) : error 004: function "OnPlayerUpdate" is not implemented C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(672) : warning 225: unreachable code C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(672) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(672) : error 004: function "OnPlayerSelectedMenuRow" is not implemented C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(677) : error 017: undefined symbol "row" C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(784) : warning 225: unreachable code C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(784) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(784) : error 004: function "OnPlayerExitedMenu" is not implemented C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(789) : error 030: compound statement not closed at the end of file (started at line 42) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 8 Errors.
|
Код:
C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(43) : warning 202: number of arguments does not match definition C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(52) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(52) : error 004: function "OnPlayerUpdate" is not implemented C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(672) : warning 225: unreachable code C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(672) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(672) : error 004: function "OnPlayerSelectedMenuRow" is not implemented C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(677) : error 017: undefined symbol "row" C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(784) : warning 225: unreachable code C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(784) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(784) : error 004: function "OnPlayerExitedMenu" is not implemented C:\Documents and Settings\Administrator\Desktop\SARP\filterscripts\Laser.pwn(789) : error 030: compound statement not closed at the end of file (started at line 42) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 8 Errors. |
public OnPlayerUpdate(playerid)
public OnPlayerSelectedMenuRow(playerid, row)
public OnPlayerExitedMenu(playerid)
if((GetPlayerInterior(playerid) == 1) && IsPlayerInRangeOfPoint(playerid,10,292.5413,-34.4905,1001.5156)) {}
|
I think it should be
pawn Код:
|