SA-MP Forums Archive
Simple Help - 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: Simple Help (/showthread.php?tid=631620)



Simple Help - silverms - 01.04.2017

Hi, I have made a simple skydive system that should when player type a command make him skydive so it is working fine and it put him in location and every thing but sometimes he can open the parachute sometimes not why?
here is the code:
PHP код:
CMD:skydive(playeridparams[])
{
    if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_RED"You Are In Vehicle Exit It First");
    if(
GetPlayerWantedLevel(playerid) >=1) return SendClientMessage(playeridCOLOR_RED"You Are Wanted Lose Your Wanted Level First!");
    new 
name[MAX_PLAYER_NAME], string[256];
     
GetPlayerName(playeridnamesizeof(name));
     
GetPlayerPos(playeridFloat:Sx[playerid], Float:Sy[playerid], Float:Sz[playerid]);
     
SetPlayerPos(playeridFloat:Sx[playerid], Float:Sy[playerid], Float:Sz[playerid]+500);
     
GivePlayerWeapon(playerid46999);
     
SendClientMessage(playeridCOLOR_RED"Welcome To Sky Dive");
     
GetPlayerName(playeridname24);
     
format(stringsizeof(string), "%s joined skydive Join Him /skydive"name);
     
SendClientMessageToAll(COLOR_BLUEstring);
     return 
1;




Re: Simple Help - AndreiWow - 01.04.2017

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(PlayerInTDSelection[playerid] == true)
{
if(clickedid == INVALID_TEXT_DRAW)
{
SendClientMessage(playerid, 0xFF0000FF, "You pressed ESC/Cancelled the textdraw selection");
return 0;
}
//rest here
}
return 1;
}

This is just an example, and I wouldn't recommend using this code in its entirety in your script. As it may not function as you desire, as it is not a full code.


Re: Simple Help - silverms - 01.04.2017

nvm for the textdraw lol


Re: Simple Help - AndreiWow - 01.04.2017

What do you mean by not being able to open it? He doesn't receive it at all, he can't scroll it or he just presses click and it doesn't open?


Re: Simple Help - silverms - 01.04.2017

no when he have parachute and he jump doesn't he have the animation of skydiving? in my case sometimes he just fall like falling without a parachute


Re: Simple Help - coool - 02.04.2017

That's because he doesn't change animation while falling, Give him parachute before setting his pos also use SetPlayerArmedWeapon
Quote:

GivePlayerWeapon(playerid, 46, 999);
SetPlayerArmedWeapon(playerid, 46);
SetPlayerPos(playerid, Float:Sx[playerid], Float:Sy[playerid], Float:Sz[playerid]+500);




Re: Simple Help - silverms - 02.04.2017

thanks