[Help] OnPlayerUpdate with command???? - 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: [Help] OnPlayerUpdate with command???? (
/showthread.php?tid=205773)
[Help] OnPlayerUpdate with command???? -
vakhtang - 02.01.2011
I made a command but I want it to be like this:
pawn Код:
public OnPlayerUpdate(playerid)
{
new Float:cam1x;
new Float:cam1y;
new Float:cam1z;
if (strcmp("/cam1", cmdtext, true, 10) == 0)
{
GetPlayerPos(playerid, cam1x, cam1y, cam1z);
SetPlayerCameraPos(playerid, -2027.0925292969, -191.03739929199, 47.638492584229);
SetPlayerCameraLookAt(playerid, cam1x, cam1y, cam1z);
return 1;
}
return 1;
}
Any Ideas
??
Re: [Help] OnPlayerUpdate with command???? -
Jay. - 02.01.2011
I don't understand, explain your problem?
Re: [Help] OnPlayerUpdate with command???? -
Calgon - 02.01.2011
You need to put your command in OnPlayerCommandText and not OnPlayerUpdate.
This callback [OnPlayerUpdate] is called everytime a client/player updates the server with their status.
Re: [Help] OnPlayerUpdate with command???? -
[NoV]LaZ - 02.01.2011
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new Float:cam1x;
new Float:cam1y;
new Float:cam1z;
if (strcmp("/cam1", cmdtext, true, 10) == 0)
{
GetPlayerPos(playerid, cam1x, cam1y, cam1z);
SetPlayerCameraPos(playerid, -2027.0925292969, -191.03739929199, 47.638492584229);
SetPlayerCameraLookAt(playerid, cam1x, cam1y, cam1z);
return 1;
}
return 0;
}
You should try using OnPlayerCommandText.
https://sampwiki.blast.hk/wiki/OnPlayerCommandText
https://sampwiki.blast.hk/wiki/OnPlayerUpdate
Re: [Help] OnPlayerUpdate with command???? -
vakhtang - 02.01.2011
Yes, but I don`t know how to make it call onplayerupdate
Like when I type /cam1 it goes to OnPlayerUpdate.
Re: [Help] OnPlayerUpdate with command???? -
Jay. - 02.01.2011
Quote:
Originally Posted by vakhtang
Yes, but I don`t know how to make it call onplayerupdate Like when I type /cam1 it goes to OnPlayerUpdate.
|
Timers?
Re: [Help] OnPlayerUpdate with command???? -
vakhtang - 02.01.2011
I used Timers But They Are LAGGY
Re: [Help] OnPlayerUpdate with command???? -
Amit_B - 02.01.2011
Quote:
Originally Posted by vakhtang
I used Timers But They Are LAGGY
|
OnPlayerUpdate will be more laggy than timers.
If you wan't to update the player camera you should use a timer, it's better for this type of scripting.