SA-MP Forums Archive
What's problem with this? - 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)
+--- Thread: What's problem with this? (/showthread.php?tid=336444)



What's problem with this? - Rudy_ - 22.04.2012

pawn Код:
new
    SuperJumpEnabled[MAX_PLAYERS] = 0;
    Float:pX,
    Float:pY,
    Float:pZ,
    IsJumping[MAX_PLAYERS];
forward IsJmping(playerid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(SuperJumpEnabled[playerid] == 0) {
    SuperJumpEnabled[playerid] = 1;
    else {
         SuperJumpEnabled[playerid] = 0;
         SendClientMessage(playerid, COLOR_TEXT, "[System]:Super Jump is Disabled");
    if(newkeys == KEY_JUMP && !IsJumping[playerid]);
    {
        IsJumping[playerid]=1;
        GetPlayerVelocity(playerid,pX,pY,pZ);
        SetPlayerVelocity(playerid,pX,pY,pZ+0.4);
        SetTimerEx("IsJmping",2500,false,"d",playerid);
    }
    return 1;
}
public IsJmping(playerid)
{
    IsJumping[playerid]=0;
}
Код:
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(207) : error 010: invalid function or declaration
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(216) : error 029: invalid expression, assumed zero
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(219) : warning 217: loose indentation
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(219) : error 017: undefined symbol "IsJumping"
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(219) : warning 215: expression has no effect
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(219) : error 001: expected token: ";", but found "]"
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(219) : error 029: invalid expression, assumed zero
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(219) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Kindly if possible tell me what's the problem, so i don't make the same mistake next time.


Re: What's problem with this? - RollTi - 22.04.2012

pawn Код:
new IsJumping[MAX_PLAYERS];



Re: What's problem with this? - Rudy_ - 22.04.2012

i have it already


Re: What's problem with this? - Scripter12345 - 22.04.2012

pawn Код:
forward IsJmping(playerid);
pawn Код:
public IsJmping(playerid)
Mis spelt jumping ?


Re: What's problem with this? - Rudy_ - 22.04.2012

O: let me see..


Re: What's problem with this? - Rudy_ - 22.04.2012

Hm..
pawn Код:
new
    SuperJumpEnabled[MAX_PLAYERS] = 0;
    Float:pX,
    Float:pY,
    Float:pZ,
    IsJumping[MAX_PLAYERS];
forward IsJumping(playerid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(SuperJumpEnabled[playerid] == 0) {
    SuperJumpEnabled[playerid] = 1;
    else {
         SuperJumpEnabled[playerid] = 0;
         SendClientMessage(playerid, COLOR_TEXT, "[System]:Super Jump is Disabled");
    if(newkeys == KEY_JUMP && !IsJumping[playerid]);
    {
        IsJumping[playerid]=1;
        GetPlayerVelocity(playerid,pX,pY,pZ);
        SetPlayerVelocity(playerid,pX,pY,pZ+0.4);
        SetTimerEx("IsJumping",2500,false,"d",playerid);
    }
    return 1;
}
public IsJumping(playerid)
{
    IsJumping[playerid]=0;
}
Код:
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(208) : error 010: invalid function or declaration
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(217) : error 029: invalid expression, assumed zero
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(220) : warning 217: loose indentation
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(220) : error 028: invalid subscript (not an array or too many subscripts): "IsJumping"
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(220) : warning 215: expression has no effect
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(220) : error 001: expected token: ";", but found "]"
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(220) : error 029: invalid expression, assumed zero
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(220) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.



Re: What's problem with this? - Rudy_ - 22.04.2012

i think i had it wrong.. what about it now?
I don't know what these error's means...
pawn Код:
new
    SuperJumpEnabled[MAX_PLAYERS];
    Float:pX, //208
    Float:pY,
    Float:pZ,
    IsJumping[MAX_PLAYERS];
forward IsJumping(playerid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(SuperJumpEnabled[playerid]) = 1; //215
    if(newkeys == KEY_JUMP && !IsJumping[playerid]); //216
    {
        IsJumping[playerid]=1;
        GetPlayerVelocity(playerid,pX,pY,pZ);
        SetPlayerVelocity(playerid,pX,pY,pZ+0.4);
        SetTimerEx("IsJumping",2500,false,"d",playerid);
    else {
         SuperJumpEnabled[playerid] = 0;
         SendClientMessage(playerid, COLOR_TEXT, "[System]:Super Jump is Disabled");
    }
    return 1;
}
public IsJumping(playerid)
{
    IsJumping[playerid]=0;
}
Код:
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(208) : error 010: invalid function or declaration
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(215) : error 029: invalid expression, assumed zero
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(215) : warning 215: expression has no effect
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(216) : error 028: invalid subscript (not an array or too many subscripts): "IsJumping"
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(216) : warning 215: expression has no effect
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(216) : error 001: expected token: ";", but found "]"
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(216) : error 029: invalid expression, assumed zero
E:\GTA - San Andreas\PAWN\gamemodes\Crysis.pwn(216) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.



Re: What's problem with this? - JoBullet - 22.04.2012

Two brackets are not closed.


Re: What's problem with this? - Rudy_ - 22.04.2012

Which? -.-, i tried but didn't found it
OT: didn't knew even making one CMD will be like this


Re: What's problem with this? - [KHK]Khalid - 22.04.2012

Try compiling this

pawn Код:
new SuperJumpEnabled[MAX_PLAYERS], Float:pX, Float:pY, Float:pZ, IsJumping[MAX_PLAYERS];

forward IsJumping(playerid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{    
    if(SuperJumpEnabled[playerid]) = 1;  
    else if(newkeys == KEY_JUMP && !IsJumping[playerid]);
    {
        IsJumping[playerid]=1;        
        GetPlayerVelocity(playerid,pX,pY,pZ);        
        SetPlayerVelocity(playerid,pX,pY,pZ+0.4);        
        SetTimerEx("IsJumping",2500,false,"d",playerid);  
    }
    else
    {        
        SuperJumpEnabled[playerid] = 0;        
        SendClientMessage(playerid, COLOR_TEXT, "[System]:Super Jump is Disabled");    
    }    
    return 1;
}
public IsJumping(playerid)
{    
    IsJumping[playerid] = 0;
    return 1;
}