public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(clickedplayerid, X, Y, Z);
SetPlayerPos(playerid, X, Y+3, Z+3);
return 1;
}
|
this is my code but it wont work. You dont teleport when u click the player
pawn Код:
|
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(clickedplayerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(clickedplayerid, X, Y, Z);
SetTimerEx("SetPlayerPosEx", 1000, false, "dfff", playerid,X+3,Y,Z+3);
return 1;
}
function SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
public SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
{
SetPlayerPos(playerid,x,y,z);
return 1;
}
|
Try it like this:
Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(clickedplayerid, X, Y, Z);
SetTimerEx("SetPlayerPosEx", 1000, false, "dfff", playerid,X+3,Y,Z+3);
return 1;
}
function SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
public SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
{
SetPlayerPos(playerid,x,y,z);
return 1;
}
|
(140) : error 010: invalid function or declaration
(141) : warning 235: public function lacks forward declaration (symbol "SetPlayerPosEx")
140: function SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
141: public SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
function SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
forward SetPlayerPosEx(playerid,Float:x,Float:y,Float:z);
Top of script:
new Tele=1;
In OnPlayerClickPlayer:
if(Tele == 0) return SendClientMessage(playerid,COLOR_RED,"Teleports are turned off!");
In /teleoff command:
if(Tele == 0)
{
Tele = 1;
SendClientMessage(playerid,COLOR_GREEN,"Teleports turned on !");
}
else
{
Tele = 0;
SendClientMessage(playerid,COLOR_GREEN,"Teleports turned off !");
}