SA-MP Forums Archive
Hey help plz! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hey help plz! (/showthread.php?tid=185844)



Hey help plz! - Mr.Jvxmc - 26.10.2010

Hey There,
how i can do that if player is somewhere stuck & type's /helpmeup, then she/he jump to a height of one meter
plz help

Regards,
Mr.Jvxmc.


Re: Hey help plz! - Cameltoe - 26.10.2010

GetPlayerPos & SetPlayerPos should get you going.

http://wiki.sa-mp.com <--- search for them there.


Re: Hey help plz! - 0ne - 26.10.2010

Set his coordinates z+1?

pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z+1);



Re: Hey help plz! - Mr.Jvxmc - 26.10.2010

maybe someone give's a code?


Re: Hey help plz! - Andrus - 26.10.2010

Quote:
Originally Posted by Mr.Jvxmc
Посмотреть сообщение
maybe someone give's a code?
pawn Код:
if(strcmp(cmd, "/helpmeup", true) == 0)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z+5);
SendClientMessage(playerid, 0x00FF00, "You shouldn't be stuck now.");
}



Re: Hey help plz! - Cameltoe - 26.10.2010

Quote:
Originally Posted by Mr.Jvxmc
Посмотреть сообщение
maybe someone give's a code?
Then WRONG SECTION.. this section isn't to request codes. https://sampforum.blast.hk/showthread.php?tid=118885


Re: Hey help plz! - Mr.Jvxmc - 26.10.2010

code is right, but it's only tp player but i want that she/he tp with car!
how i can do that?


Re: Hey help plz! - Cameltoe - 26.10.2010

Quote:
Originally Posted by Mr.Jvxmc
Посмотреть сообщение
code is right, but it's only tp player but i want that she/he tp with car!
how i can do that?
IsPlayerInAnyVehicle <-- learn to search.


Re: Hey help plz! - Mr.Jvxmc - 26.10.2010

it's compile, but ingame deosn't vehicle jump only human

// CODE
Код:
    if(strcmp(cmd, "/helpmeup", true) == 0)
    {
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    SetPlayerPos(playerid,x,y,z+5);
    if (IsPlayerInAnyVehicle(playerid))
    SendClientMessage(playerid, 0x00FF00, "You shouldn't be stuck now.");
    return 1;
    }



Re: Hey help plz! - Cameltoe - 26.10.2010

Ofc.. ur setting the char pos not the vehicle pos.
Код:
if(strcmp(cmd, "/helpmeup", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x00FF00, "You have to be inside an vehicle to use this...");
new Float:x,Float:y,Float:z;
GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z+5);
SendClientMessage(playerid, 0x00FF00, "You shouldn't be stuck now.");
return 1;
}
BTW: use [pawn] tags instead of [code] Makes it easier to read.
pawn Код:
if(strcmp(cmd, "/helpmeup", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x00FF00, "You have to be inside an vehicle to use this...");
new Float:x,Float:y,Float:z;
GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z+5);
SendClientMessage(playerid, 0x00FF00, "You shouldn't be stuck now.");
return 1;
}