i need Help with player pos. REP ++ -
Configuration - 09.04.2013
i have cmd /pause and if i type /back player dont go when i use pause help me with this. REP ++
Re: i need Help with player pos. REP ++ -
ScripteRMKD - 09.04.2013
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);
}
Re: i need Help with player pos. REP ++ -
Configuration - 09.04.2013
i have this but i need when plaer go pause and i spawn it go in what pos was understand?
Re: i need Help with player pos. REP ++ -
Riddick94 - 09.04.2013
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
Re: i need Help with player pos. REP ++ -
Configuration - 09.04.2013
But how if i know dont post here can you create it and give me?
Re: i need Help with player pos. REP ++ -
Riddick94 - 09.04.2013
Do you know how to declare floating points variables as global variables?
Re: i need Help with player pos. REP ++ -
Configuration - 09.04.2013
no :/
Re: i need Help with player pos. REP ++ -
woot - 09.04.2013
https://sampwiki.blast.hk/wiki/Scripting_Basics
Re: i need Help with player pos. REP ++ -
Configuration - 09.04.2013
For what is this?
Re: i need Help with player pos. REP ++ -
Riddick94 - 09.04.2013
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.