How to go to drive on water? -
_Application_ - 02.12.2014
How to go to drive on water?
Re: How to go to drive on water? -
Schneider - 02.12.2014
I don't know, but maybe there are invisible objects, but with a collision-box that you can place on the watersuface?
Re: How to go to drive on water? -
Abagail - 02.12.2014
You can't drive on water, but as Schenider said you can place invisible objects, how-ever you can't actually physically drive on water in SA-MP. Maybe using a plug-in such as SA-MP+ you can(I suppose SAMP+ might be able to remotely call the drive on water cheat?)
There is a cheat in singleplayer to drive on water.
Re: How to go to drive on water? -
Luis- - 02.12.2014
SA-MP+ has the ability to allow you to drive on water.
Re: How to go to drive on water? -
Abagail - 02.12.2014
Even found the function for you...
pawn Код:
native TogglePlayerDriveOnWater(playerid, bool:toggle);
For example, using this code if a player types the words "waterfun" then they can drive on water. If activated, this feature is deactivated.
pawn Код:
public OnPlayerText(playerid,text[])
{
if(strcmp(text, "waterfun", true) == 0)
{
if(!IsPlayerSAMPP(playerid)) return SendClientMessage(playerid, -1, "You do not have the SA:MP plugin.");
if(WaterFun[playerid] == true)
{
TogglePlayerDriveOnWater(playerid, false);
WaterFun[playerid] = false;
GameTextForPlayer(playerid, "Cheat De-Activated", 2, 10000);
return 1;
}
else
{
TogglePlayerDriveOnWater(playerid, true);
WaterFun[playerid] = true;
GameTextForPlayer(playerid, "Cheat Activated", 2, 10000);
return 1;
}
}
return 1;
}
Re: How to go to drive on water? -
gtakillerIV - 02.12.2014
Here's the wiki link for more information:
https://github.com/KingHual/SA-MP-Pl...erDriveOnWater
It would be better to use
IsUsingSAMPP to check if the player has the plugin installed. And if he doesn't, you can send a message saying that he needs the plugin.
Although it doesn't really matter(the game won't crash), I think it's a nice touch to the command so the player can actually know whether something has taken place or not.
And thanks to the guys above for suggesting the plugin, it helps out the project a lot.
Re: How to go to drive on water? -
Abagail - 02.12.2014
Yeah I forgot about that. I have added IsUsingSAMPP to my example.
Re: How to go to drive on water? -
_Application_ - 03.12.2014
Quote:
Originally Posted by Abagail
Yeah I forgot about that. I have added IsUsingSAMPP to my example.
|
How to do it with attaching a transparent object?
I did this:
http://pastebin.com/pePZb6wQ
It works only partially and inefficiently,
Look on the server and you will understand, help me to fix it
sorry my bad english
Quote:
Originally Posted by gtakillerIV
Here's the wiki link for more information: https://github.com/KingHual/SA-MP-Pl...erDriveOnWater
It would be better to use IsUsingSAMPP to check if the player has the plugin installed. And if he doesn't, you can send a message saying that he needs the plugin.
Although it doesn't really matter(the game won't crash), I think it's a nice touch to the command so the player can actually know whether something has taken place or not.
And thanks to the guys above for suggesting the plugin, it helps out the project a lot.
|
I did this:
http://pastebin.com/pePZb6wQ
It works only partially and inefficiently,
Look on the server and you will understand, help me to fix it
sorry my bad english
Re: How to go to drive on water? -
Schneider - 03.12.2014
(sorry, please delete this post)
Re: How to go to drive on water? -
Schneider - 03.12.2014
Here, this code works:
You might want to add an extra check to see if the player is not in the quary (since that location is below waterlevel.
pawn Код:
#include <a_samp>
new WalkWaterObject[MAX_PLAYERS];
new bool:WalkingOnWater[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/walkwater", true))
{
if(WalkingOnWater[playerid] == false)
{
WalkWaterObject[playerid] = CreatePlayerObject(playerid, 8661, 0.000000, 0.000000, 0.000000, 178.400314,0.000000,0.000000);
WalkingOnWater[playerid] = true;
SendClientMessage(playerid, 0x00FF00AA, "Walking on water enabled");
return 1;
}
else
{
DestroyPlayerObject(playerid, WalkWaterObject[playerid]);
WalkingOnWater[playerid] = false;
SendClientMessage(playerid, 0xFF0000AA, "Walking on water disabled");
}
return 1;
}
return 0;
}
public OnPlayerDisconnect(playerid, reason)
{
if(WalkingOnWater[playerid] == true)
{
DestroyPlayerObject(playerid, WalkWaterObject[playerid]);
WalkingOnWater[playerid] = false;
}
return 1;
}
public OnPlayerUpdate(playerid)
{
if(WalkingOnWater[playerid] == true)
{
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
if(pos[2] < 2)
{
SetPlayerObjectPos(playerid, WalkWaterObject[playerid], pos[0], pos[1], 0.2);
}
}
return 1;
}