How to make somewan jump higher/run faster and some other problems
#1

Hello poeple, Ok so im currently working on a Script thats actually pretty cool. if you know the game Crysis than you know what im talking about !, ok so i am looking all over the internet to find how i can make poeple jump higher and run faster, like in the crysis game! im also looking on how to make teams but i dont understand
anything >.<! but my main thing is the Jumping and sprinting. edit : is there a way to bind commands to certain keys? like jump = Lshift and sprint Lalt? i would really love it !
(---> im currently also looking for scripters/mappers! <---)

pawn Код:
//===========================================================================================
// Nano Power Survival has been made by Eric Graventein ( CyberrCookie )                    |
// Version : NP V1.0                                                                        |
// CopyRight Nano Power Survival V1.0                                                       |
// Scripters : Eric Graventein ( CyberrCookie ) : e.graventein@hotmail.nl                   |
// Mapper : Eric Graventein ( CyberrCookie ) : e.graventein@hotmail.nl                      |
// Thanks to ******* Tutorial video's! They helped me alot.                                 |
// Thanks to the Poeple of the SA-MP forums for fixing some Bugs / Glitches / and other...  |
//===========================================================================================
//Defines=======================================================================
#define LIGHTBLUE 0x33CCFFAA
#define RED 0xAA3333AA
#define GREY 0xAFAFAFAA
#define YELLOW 0xFFFF00AA
#define PINK 0xFF66FFAA
#define BLUE 0x0000BBAA
#define WHITE 0xFFFFFFAA
#define DARKRED 0x660000AA
#define ORANGE 0xFF9900AA
#define BRIGHTRED 0xFF0000AA
#define INDIGO 0x4B00B0AA
#define VIOLET 0x9955DEEE
#define LIGHTRED 0xFF99AADD
#define SEAGREEN 0x00EEADDF
#define GRAYWHITE 0xEEEEFFC4
#define LIGHTNEUTRALBLUE 0xabcdef66
#define GREENISHGOLD 0xCCFFDD56
#define LIGHTBLUEGREEN 0x0FFDD349
#define NEUTRALBLUE 0xABCDEF01
#define LIGHTCYAN 0xAAFFCC33
#define LEMON 0xDDDD2357
#define MEDIUMBLUE 0x63AFF00A
#define NEUTRAL 0xABCDEF97
#define BLACK 0x00000000
#define NEUTRALGREEN 0x81CFAB00
#define DARKGREEN 0x12900BBF
#define LIGHTGREEN 0x24FF0AB9
#define DARKBLUE 0x300FFAAB
#define BLUEGREEN 0x46BBAA00
#define PINK 0xFF66FFAA
#define LIGHTBLUE 0x33CCFFAA
#define DARKRED 0x660000AA
#define ORANGE 0xFF9900AA
#define PURPLE 0x800080AA
#define GRAD1 0xB4B5B7FF
#define GRAD2 0xBFC0C2FF
#define RED1 0xFF0000AA
#define GREY 0xAFAFAFAA
#define GREEN 0x33AA33AA
#define RED 0xAA3333AA
#define YELLOW 0xFFFF00AA
#define WHITE 0xFFFFFFAA
#define BROWN 0x993300AA
#define CYAN 0x99FFFFAA
#define TAN 0xFFFFCCAA
#define PINK 0xFF66FFAA
#define KHAKI 0x999900AA
#define LIME 0x99FF00AA
//Includes======================================================================
#include <a_samp>
//Variables=====================================================================

//Game Mode=====================================================================
main()
{
    print("\n-----------------------");
    print("   Nano Power Survival   ");
    print("-----------------------\n");
    print(" All CopyRights NPS V1.0 ");
}
public OnGameModeInit()
{
    print("Nano Cells Initiated, Starting Server...");
    SetGameModeText("NP V2.0");
    UsePlayerPedAnims();
    AddPlayerClass(283, 5, 5, 5, 360, 23, 100, 25, 150, 0, 0);
    AddPlayerClass(283, 5, 5, 5, 360, 23, 100, 32, 800, 0, 0);
    AddPlayerClass(288, 5, 5, 5, 360, 23, 100, 32, 800, 0, 0);
    AddPlayerClass(283, 5, 5, 5, 360, 23, 100, 25, 150, 0, 0);
    return 1;
}
public OnGameModeExit()
{
    print("Shutting down Nano Cells, Good Bye!");
    return 1;
}
//PlayerConnect/Disconect=======================================================
public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, BLUE,      "==========================================");
    SendClientMessage(playerid, GREY,      "NANO SUIT: Welcome to Nano Power Survival ");
    SendClientMessage(playerid, WHITE,     "NANO SUIT: Enjoy your stay!               ");
    SendClientMessage(playerid, BLUE,      "==========================================");
    SendClientMessageToAll(GREY,           "NANO SUIT: A player joined the server     ");
    SetWeather(43);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SendClientMessageToAll(GREY,           "NANO SUIT: A player left the server       ");
    return 1;
}
//Class/Spawn/Death=============================================================
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 5, 5, 5);
    SetPlayerFacingAngle(playerid, 270.0);
    SetPlayerCameraPos(playerid, 6, 6, 6);
    SetPlayerCameraLookAt(playerid, 5, 5, 5);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SendClientMessage(playerid, YELLOW, "Type /help for help to se all commands and rules.");
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SendClientMessage(playerid, RED, "NANO SUIT: Systems failing, Fatel error.");
    return 1;
}
//PlayerCommands================================================================
// Advanced Nano Technology=====================================================
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/wearetheleadingforce", cmdtext))
    {
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    SetPlayerSkin(playerid, 287);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 24, 100);
    GivePlayerWeapon(playerid, 27, 200);
    GivePlayerWeapon(playerid, 31, 500);
    SendClientMessage(playerid, BLUE, "NANO SUIT: Nano Cells initiating, Booting up suit...... DNA recognized. Welcome back sir.");
    SendClientMessageToAll(WHITE, "NANO SUIT: Somewan has logged in on his Advanced Nano Suit.");
    return 1;
    }
    if (!strcmp("/maximumarmour", cmdtext))
    {
    SendClientMessage(playerid, BLUE, "NANO SUIT: Maximum Armour!");
    SendClientMessage(playerid, WHITE,"Now you have 2x 100 armour.");
    SetPlayerArmour(playerid, 200);
    return 1;
    }
    if (!strcmp("/maximumstrength", cmdtext))
    {
    SendClientMessage(playerid, BLUE, "NANO SUIT: Maximum Stength!");
    SetPlayerVelocity(playerid,0.0,0.0,1.5);
    return 1;
    }
    return 0;
}
Reply
#2

OMG?? HELP ME PLEASE
Reply
#3

SetPlayerVelocity, research it on ******.

https://sampwiki.blast.hk/wiki/SetPlayerVelocity
Reply
#4

Quote:
Originally Posted by CyberrCookie
Посмотреть сообщение
OMG?? HELP ME PLEASE
Did it pass 48 hours since last post?NO!!!And what's better,now that I replied,you must wait other 48 hours,from now ON,because I posted .
Reply
#5

Quote:
Originally Posted by Blunt
Посмотреть сообщение
SetPlayerVelocity, research it on ******.

https://sampwiki.blast.hk/wiki/SetPlayerVelocity
no it dont work or i do it wrong >.<! when i try it and i type the command the player dies. and i want poeple to be able to brun and press L SHIFT and jump not type a command ;s pls help!
Reply
#6

hmm show the code of the cmd
Reply
#7

Quote:
Originally Posted by nilanjay
Посмотреть сообщение
hmm show the code of the cmd
this is the code for the Jump : ( they are at the bottem of my script that i posted up!)

if (!strcmp("/maximumstrength", cmdtext))
{
SendClientMessage(playerid, BLUE, "NANO SUIT: Maximum Stength!");
SetPlayerVelocity(playerid,0.0,0.0,1.5);
return 1;
}
return 0;
}

and the code for the speed : (but its not what i wanted.. it just spawns you some feet forward and it kills you)

f (!strcmp("/maximumspeed", cmdtext))
{
SendClientMessage(playerid, BLUE, "NANO SUIT: Maximum Speed!");
SetPlayerVelocity(playerid,0.0,1.0,0.0);
return 1;
}

but this doesnt do what i want.. i want poeple to be able to jump ighe when they move wwhen pressing a button on their keyboard. by typing this command its like a slap command >.<! and the speed command just puts you a few feet forward and kills you.
Reply
#8

heres a keybind for jump. you may want to combine it with some kind of godmode as it kills you sometimes when you land.

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

forward IsJmping(playerid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    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;
}
Reply
#9

Quote:
Originally Posted by MeDaKewlDude
Посмотреть сообщение
heres a keybind for jump. you may want to combine it with some kind of godmode as it kills you sometimes when you land.

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

forward IsJmping(playerid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    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;
}
Much thanks! but can you look under in my script? i want only player that type /wearetheleadingforce to be able to jump higher. poeple that are not in this faction must ahve a lower jumping advantage. how can i restrict poeple from doing this ? can you help me make teams?/factions ! thx fr you help anyway
Reply
#10

try this:
pawn Код:
//===========================================================================================
// Nano Power Survival has been made by Eric Graventein ( CyberrCookie )                    |
// Version : NP V1.0                                                                        |
// CopyRight Nano Power Survival V1.0                                                       |
// Scripters : Eric Graventein ( CyberrCookie ) : e.graventein@hotmail.nl                   |
// Mapper : Eric Graventein ( CyberrCookie ) : e.graventein@hotmail.nl                      |
// Thanks to ******* Tutorial video's! They helped me alot.                                 |
// Thanks to the Poeple of the SA-MP forums for fixing some Bugs / Glitches / and other...  |
//===========================================================================================
//Defines=======================================================================
#define LIGHTBLUE 0x33CCFFAA
#define RED 0xAA3333AA
#define GREY 0xAFAFAFAA
#define YELLOW 0xFFFF00AA
#define PINK 0xFF66FFAA
#define BLUE 0x0000BBAA
#define WHITE 0xFFFFFFAA
#define DARKRED 0x660000AA
#define ORANGE 0xFF9900AA
#define BRIGHTRED 0xFF0000AA
#define INDIGO 0x4B00B0AA
#define VIOLET 0x9955DEEE
#define LIGHTRED 0xFF99AADD
#define SEAGREEN 0x00EEADDF
#define GRAYWHITE 0xEEEEFFC4
#define LIGHTNEUTRALBLUE 0xabcdef66
#define GREENISHGOLD 0xCCFFDD56
#define LIGHTBLUEGREEN 0x0FFDD349
#define NEUTRALBLUE 0xABCDEF01
#define LIGHTCYAN 0xAAFFCC33
#define LEMON 0xDDDD2357
#define MEDIUMBLUE 0x63AFF00A
#define NEUTRAL 0xABCDEF97
#define BLACK 0x00000000
#define NEUTRALGREEN 0x81CFAB00
#define DARKGREEN 0x12900BBF
#define LIGHTGREEN 0x24FF0AB9
#define DARKBLUE 0x300FFAAB
#define BLUEGREEN 0x46BBAA00
#define PINK 0xFF66FFAA
#define LIGHTBLUE 0x33CCFFAA
#define DARKRED 0x660000AA
#define ORANGE 0xFF9900AA
#define PURPLE 0x800080AA
#define GRAD1 0xB4B5B7FF
#define GRAD2 0xBFC0C2FF
#define RED1 0xFF0000AA
#define GREY 0xAFAFAFAA
#define GREEN 0x33AA33AA
#define RED 0xAA3333AA
#define YELLOW 0xFFFF00AA
#define WHITE 0xFFFFFFAA
#define BROWN 0x993300AA
#define CYAN 0x99FFFFAA
#define TAN 0xFFFFCCAA
#define PINK 0xFF66FFAA
#define KHAKI 0x999900AA
#define LIME 0x99FF00AA
#define MAX_PLAYERS_ 50

#define TEAM1 1
#define TEAM2 2
//Includes======================================================================
#include <a_samp>
//Variables=====================================================================

//Game Mode=====================================================================
main()
{
    print("\n-----------------------");
    print("   Nano Power Survival   ");
    print("-----------------------\n");
    print(" All CopyRights NPS V1.0 ");
}

new
    Float:pX[MAX_PLAYERS_],
    Float:pY[MAX_PLAYERS_],
    Float:pZ[MAX_PLAYERS_],
    IsJumping[MAX_PLAYERS_],
    pTeam[MAX_PLAYERS_],
    leadingforce[MAX_PLAYERS_];
   
public OnGameModeInit()
{
    print("Nano Cells Initiated, Starting Server...");
    SetGameModeText("NP V2.0");
    //UsePlayerPedAnims();
    AddPlayerClass(283, 5, 5, 5, 360, 23, 100, 25, 150, 0, 0);
    AddPlayerClass(283, 5, 5, 5, 360, 23, 100, 32, 800, 0, 0);
    AddPlayerClass(288, 5, 5, 5, 360, 23, 100, 32, 800, 0, 0);
    AddPlayerClass(283, 5, 5, 5, 360, 23, 100, 25, 150, 0, 0);
    return 1;
}
public OnGameModeExit()
{
    print("Shutting down Nano Cells, Good Bye!");
    return 1;
}
//PlayerConnect/Disconect=======================================================
public OnPlayerConnect(playerid)
{
    leadingforce[playerid]=0;
    SendClientMessage(playerid, BLUE,      "==========================================");
    SendClientMessage(playerid, GREY,      "NANO SUIT: Welcome to Nano Power Survival ");
    SendClientMessage(playerid, WHITE,     "NANO SUIT: Enjoy your stay!               ");
    SendClientMessage(playerid, BLUE,      "==========================================");
    SendClientMessageToAll(GREY,           "NANO SUIT: A player joined the server     ");
    SetWeather(43);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SendClientMessageToAll(GREY,           "NANO SUIT: A player left the server       ");
    leadingforce[playerid]=0;
    return 1;
}
//Class/Spawn/Death=============================================================
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 5, 5, 5);
    SetPlayerFacingAngle(playerid, 270.0);
    SetPlayerCameraPos(playerid, 6, 6, 6);
    SetPlayerCameraLookAt(playerid, 5, 5, 5);
    switch(classid)
    {
        case 0:
        {
            pTeam[playerid] = TEAM1;
            SetPlayerColor(playerid,GREEN);
        }
        case 1:
        {
            pTeam[playerid] = TEAM1;
            SetPlayerColor(playerid,GREEN);
        }
        case 2:
        {
            pTeam[playerid] = TEAM2;
            SetPlayerColor(playerid,RED);
        }
        case 3:
        {
            pTeam[playerid] = TEAM2;
            SetPlayerColor(playerid,RED);
        }
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SendClientMessage(playerid, YELLOW, "Type /help for help to se all commands and rules.");
    SetPlayerPos(playerid, 5, 5, 5);
    SetPlayerFacingAngle(playerid, 270.0);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SendClientMessage(playerid, RED, "NANO SUIT: Systems failing, Fatel error.");
    return 1;
}
//PlayerCommands================================================================
// Advanced Nano Technology=====================================================
public OnPlayerCommandText(playerid, cmdtext[])
{



    if (!strcmp("/wearetheleadingforce", cmdtext))
    {
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    SetPlayerSkin(playerid, 287);
    leadingforce[playerid]=1;
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 24, 100);
    GivePlayerWeapon(playerid, 27, 200);
    GivePlayerWeapon(playerid, 31, 500);
    SendClientMessage(playerid, BLUE, "NANO SUIT: Nano Cells initiating, Booting up suit...... DNA recognized. Welcome back sir.");
    SendClientMessageToAll(WHITE, "NANO SUIT: Somewan has logged in on his Advanced Nano Suit.");
    return 1;
    }
    if (!strcmp("/maximumarmour", cmdtext))
    {
    SendClientMessage(playerid, BLUE, "NANO SUIT: Maximum Armour!");
    SendClientMessage(playerid, WHITE,"Now you have 2x 100 armour.");
    SetPlayerArmour(playerid, 200);
    return 1;
    }
    if (!strcmp("/maximumstrength", cmdtext))
    {
    SendClientMessage(playerid, BLUE, "NANO SUIT: Maximum Stength!");
    SetPlayerVelocity(playerid,0.0,0.0,1.5);
    return 1;
    }
    return 0;
}


forward IsJmping(playerid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_JUMP && !IsJumping[playerid])
    {
        if(leadingforce[playerid])
        {
            IsJumping[playerid]=1;
            GetPlayerVelocity(playerid,pX[playerid],pY[playerid],pZ[playerid]);
            SetPlayerVelocity(playerid,pX[playerid],pY[playerid],pZ[playerid]+0.4);
            SetTimerEx("IsJmping",2500,false,"d",playerid);
        }
        else
        {
            IsJumping[playerid]=1;
            GetPlayerVelocity(playerid,pX[playerid],pY[playerid],pZ[playerid]);
            SetPlayerVelocity(playerid,pX[playerid],pY[playerid],pZ[playerid]+0.2);
            SetTimerEx("IsJmping",2500,false,"d",playerid);
        }
    }
    return 1;
}
public IsJmping(playerid)
{
IsJumping[playerid]=0;
}
the "#define TEAM1 1" and "#define TEAM2 2" are the teams.to restrict soomething to one team, do
pawn Код:
if(pTeam[playerid]==TEAM1)
{
//enter code
}
for team 1 and
pawn Код:
if(pTeam[playerid]==TEAM2)
{
//enter code
}
for team 2.

to restrict something to the people who did "/wearetheleadingforce"
type:
pawn Код:
if(leadingforce[playerid])
{
//enter code
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)