OnPlayerClickPlayer
#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+3, Z+3);
    return 1;
}
Reply
#2

Quote:
Originally Posted by googamalugafoo
Посмотреть сообщение
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+3, Z+3);
    return 1;
}
Just try like this:
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;
}
Reply
#3

still nothing.
Reply
#4

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;
}
Reply
#5

OnPlayerClickPlayer is getting called when you click a player through TAB button, i am just saying!
Reply
#6

i know... It used to work but now it stopped
Reply
#7

Quote:
Originally Posted by coole210
Посмотреть сообщение
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;
}
pawn Код:
(140) : error 010: invalid function or declaration
(141) : warning 235: public function lacks forward declaration (symbol "SetPlayerPosEx")
pawn Код:
140: function SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
141: public SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
Reply
#8

pawn Код:
function SetPlayerPosEx(playerid,Float:x,Float:y,Float:z)
should be
pawn Код:
forward SetPlayerPosEx(playerid,Float:x,Float:y,Float:z);
Reply
#9

Thanks it worked. How can i make it so an admin can do /teleoff and players cant teleport anymore. Then do /teleon
Reply
#10

Код:
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 !");
}
rep please
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)