i need Help with player pos. REP ++
#1

i have cmd /pause and if i type /back player dont go when i use pause help me with this. REP ++
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/pause", true) == 0)
{
OnPlayerPause(playerid);
new string[120];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string), sizeof(string), "%s is now AFK", sendername);
SendClientMessageToAll(COLOR_WHITE, string);
}
if(strcmp(cmdtext, "/back", true) == 0)
{
new string[120];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string), sizeof(string), "%s is now Back from AFK", sendername);
SendClientMessageToAll(COLOR_WHITE, string);
}
Reply
#3

i have this but i need when plaer go pause and i spawn it go in what pos was understand?
Reply
#4

Create global variables for:

- Position X
- Position Y
- Position Z
- Position Angle
- Interior
- Virtual world

When player type command "/pause", store player pos to global variables and then read them in "/back" command and use a proper functions.

Get/SetPlayerPos
Get/SetPlayerFacingAngle
Get/SetPlayerInterior
Get/SetPlayerVirtualWorld
Reply
#5

But how if i know dont post here can you create it and give me?
Reply
#6

Do you know how to declare floating points variables as global variables?
Reply
#7

no :/
Reply
#8

https://sampwiki.blast.hk/wiki/Scripting_Basics
Reply
#9

For what is this?
Reply
#10

Top of your script, underneath of includes:

pawn Код:
new Float:PosX, Float:PosY, Float:PosZ, Float:PosA,
    Interior, VirtualWorld;
It's called global variables. But we have to use array for each player, so it's gonna be like:

pawn Код:
new Float:PosX[MAX_PLAYERS], Float:PosY[MAX_PLAYERS], Float:PosZ[MAX_PLAYERS], Float:PosA[MAX_PLAYERS],
    Interior[MAX_PLAYERS], VirtualWorld[MAX_PLAYERS];
Now you have to go to yours "/pause" command and use functions which names I given you in previous post(s) (Get) and store values to the global arrays from above. Then you have to read Global Arrays values in "/back" command with functions from previous post(s) as well (Set).

Check on Wiki.SA-MP how each function works and what parameters does it including.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)