if( newkeys == KEY_SECONDARY_ATTACK ) //55589
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 1480.9410,-1771.8586,18.7958 ) )
{
SetPlayerPos( playerid, 386.2978,173.8582,1008.3828 );
SetPlayerInterior( playerid, 15 );
GameTextForPlayer( playerid, "Welcome to city hall", 3000, 1 );
return 1;
}
}
if( newkeys == KEY_SECONDARY_ATTACK )
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 386.2978,173.8582,1008.3828 ) )
SetPlayerPos( playerid, 1480.9410,-1771.8586,18.7958 );
SetPlayerInterior( playerid, 0);
GameTextForPlayer( playerid, "Goodbye", 3000, 1 );
return 1;
}
}
}
}
return 1;
}
if( newkeys == KEY_SECONDARY_ATTACK ) //55589
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 1480.9410,-1771.8586,18.7958 ) )
{
SetPlayerPos( playerid, 386.2978,173.8582,1008.3828 );
SetPlayerInterior( playerid, 15 );
GameTextForPlayer( playerid, "Welcome to city hall", 3000, 1 );
return 1;
}
}
if( newkeys == KEY_SECONDARY_ATTACK )
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 386.2978,173.8582,1008.3828 ) )
{
SetPlayerPos( playerid, 1480.9410,-1771.8586,18.7958 );
SetPlayerInterior( playerid, 0);
GameTextForPlayer( playerid, "Goodbye", 3000, 1 );
return 1;
}
}
return 1;
That was painful to look at, please learn to write readable code.
PHP код:
It contains useful information on how to properly detect Keys, scroll down, you'll find read macros for that. |
script.pwn(12077) : error 004: function "LoadDrugSystem" is not implemented
script.pwn(12078) : error 004: function "LoadMatsSystem" is not implemented
script.pwn(12079) : error 004: function "LoadTrunk" is not implemented
script.pwn(20268) : error 004: function "ini_GetKey" is not implemented
script.pwn(20268) : error 033: array must be indexed (variable "keytmp")
script.pwn(20271) : error 004: function "ini_GetValue" is not implemented
script.pwn(20271) : error 033: array must be indexed (variable "valtmp")
script.pwn(20280) : error 004: function "ini_GetKey" is not implemented
script.pwn(20280) : error 033: array must be indexed (variable "key")
script.pwn(20281) : error 004: function "ini_GetValue" is not implemented
script.pwn(20281) : error 033: array must be indexed (variable "val")
script.pwn(20282) : error 004: function "ini_GetValue" is not implemented
script.pwn(20282) : error 033: array must be indexed (variable "val")
script.pwn(20283) : error 004: function "ini_GetValue" is not implemented
script.pwn(20283) : error 033: array must be indexed (variable "val")
script.pwn(20284) : error 004: function "ini_GetValue" is not implemented
script.pwn(20284) : error 033: array must be indexed (variable "val")
script.pwn(20285) : error 004: function "ini_GetValue" is not implemented
script.pwn(20285) : error 033: array must be indexed (variable "val")
script.pwn(20286) : error 004: function "ini_GetValue" is not implemented
script.pwn(20286) : error 033: array must be indexed (variable "val")
script.pwn(20287) : error 004: function "ini_GetValue" is not implemented
script.pwn(20287) : error 033: array must be indexed (variable "val")
script.pwn(20288) : error 004: function "ini_GetValue" is not implemented
script.pwn(20288) : error 033: array must be indexed (variable "val")
script.pwn(20289) : error 004: function "ini_GetValue" is not implemented
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
26 Errors.
it is because of a missing bracket put } under the last return 1; it should work
|
if( newkeys == KEY_SECONDARY_ATTACK ) //55589
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 1480.9410,-1771.8586,18.7958 ) )
{
SetPlayerPos( playerid, 386.2978,173.8582,1008.3828 );
SetPlayerInterior( playerid, 15 );
GameTextForPlayer( playerid, "Welcome to city hall", 3000, 1 );
}
}
if( newkeys == KEY_SECONDARY_ATTACK )
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 386.2978,173.8582,1008.3828 ) )
SetPlayerPos( playerid, 1480.9410,-1771.8586,18.7958 );
SetPlayerInterior( playerid, 0);
GameTextForPlayer( playerid, "Goodbye", 3000, 1 );
return 1;
}
}
return 1;
}
if( newkeys == KEY_SECONDARY_ATTACK ) { if( IsPlayerInRangeOfPoint( playerid, 3.0, 386.2978,173.8582,1008.3828 ) ) SetPlayerPos( playerid, 1480.9410,-1771.8586,18.7958 ); SetPlayerInterior( playerid, 0); GameTextForPlayer( playerid, "Goodbye", 3000, 1 ); return 1; }
if( newkeys == KEY_SECONDARY_ATTACK ) { if( IsPlayerInRangeOfPoint( playerid, 3.0, 386.2978,173.8582,1008.3828 ) ) { SetPlayerPos( playerid, 1480.9410,-1771.8586,18.7958 ); SetPlayerInterior( playerid, 0); GameTextForPlayer( playerid, "Goodbye", 3000, 1 ); } return 1; }
Your original problem is that you have return 1; at the end of the code when every "if" statement ends with return 1;
So all you ahve to do is remove the last return 1; and the w arning will go away. The way you've done it above is wrong, you've removed the wrong return. You also need to have {} after an if statement if you have more than one function. IE: Код:
if( newkeys == KEY_SECONDARY_ATTACK ) { if( IsPlayerInRangeOfPoint( playerid, 3.0, 386.2978,173.8582,1008.3828 ) ) SetPlayerPos( playerid, 1480.9410,-1771.8586,18.7958 ); SetPlayerInterior( playerid, 0); GameTextForPlayer( playerid, "Goodbye", 3000, 1 ); return 1; } Код:
if( newkeys == KEY_SECONDARY_ATTACK ) { if( IsPlayerInRangeOfPoint( playerid, 3.0, 386.2978,173.8582,1008.3828 ) ) { SetPlayerPos( playerid, 1480.9410,-1771.8586,18.7958 ); SetPlayerInterior( playerid, 0); GameTextForPlayer( playerid, "Goodbye", 3000, 1 ); } return 1; } |
if( newkeys == KEY_SECONDARY_ATTACK ) //55589
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 1480.9410,-1771.8586,18.7958 ) )
{
SetPlayerPos( playerid, 386.2978,173.8582,1008.3828 );
SetPlayerInterior( playerid, 15 );
GameTextForPlayer( playerid, "Welcome to city hall", 3000, 1 );
}
}
if( newkeys == KEY_SECONDARY_ATTACK )
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 386.2978,173.8582,1008.3828 ) )
{
SetPlayerPos( playerid, 1480.9410,-1771.8586,18.7958 );
SetPlayerInterior( playerid, 0);
GameTextForPlayer( playerid, "Goodbye", 3000, 1 );
}
return 1;
}
if( newkeys == KEY_SECONDARY_ATTACK ) //55589
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 1480.9410,-1771.8586,18.7958 ) )
{
SetPlayerPos( playerid, 386.2978,173.8582,1008.3828 );
SetPlayerInterior( playerid, 15 );
GameTextForPlayer( playerid, "Welcome to city hall", 3000, 1 );
}
}
if( newkeys == KEY_SECONDARY_ATTACK )
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 386.2978,173.8582,1008.3828 ) )
SetPlayerPos( playerid, 1480.9410,-1771.8586,18.7958 );
SetPlayerInterior( playerid, 0);
GameTextForPlayer( playerid, "Goodbye", 3000, 1 );
return 1;
}
}
return 1;
}
if( newkeys == KEY_SECONDARY_ATTACK ) //55589
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 1480.9410,-1771.8586,18.7958 ) )
{
SetPlayerPos( playerid, 386.2978,173.8582,1008.3828 );
SetPlayerInterior( playerid, 15 );
GameTextForPlayer( playerid, "Welcome to city hall", 3000, 1 );
return 1;
}
}
if( newkeys == KEY_SECONDARY_ATTACK )
{
if( IsPlayerInRangeOfPoint( playerid, 3.0, 386.2978,173.8582,1008.3828 ) )
SetPlayerPos( playerid, 1480.9410,-1771.8586,18.7958 );
SetPlayerInterior( playerid, 0);
GameTextForPlayer( playerid, "Goodbye", 3000, 1 );
return 1;
}
}
return 1;
}