SA-MP Forums Archive
2 quick questions. (NoDmg and SavePlayerPos) - 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)
+--- Thread: 2 quick questions. (NoDmg and SavePlayerPos) (/showthread.php?tid=463914)



2 quick questions. (NoDmg and SavePlayerPos) - Jason_Roul - 14.09.2013

So basically I've scripted a Jefferson Motel DM but I want it to be like that once you choose to be a cop, to stay there until you do /leavejdm
Also, how would I be off doing something like, if this skin, damages this skin, no damage is taken due to being in the same team.


Re: 2 quick questions. (NoDmg and SavePlayerPos) - [HK]Ryder[AN] - 14.09.2013

You can use the SetPlayerTeam); function. It disables friendly fire if 2 people are in the same team


Re: 2 quick questions. (NoDmg and SavePlayerPos) - Jason_Roul - 14.09.2013

Thanks for that Ryder, really helpful!
Just have to find out how to SavePlayerPos now :/.


Re: 2 quick questions. (NoDmg and SavePlayerPos) - [HK]Ryder[AN] - 14.09.2013

If by that you require to save someone's position, you can do it like this

pawn Код:
//On top of your script, outside a callback
new Float:SaveX[MAX_PLAYERS], Float:SaveY[MAX_PLAYERS], Float:SaveZ[MAX_PLAYERS];

//Later on
stock SavePlayerPos(playerid)
{
GetPlayerPos(playerid, SaveX[playerid], SaveY[playerid], SaveZ[playerid];
return 1;
}
Their position will be saved in them values


Re: 2 quick questions. (NoDmg and SavePlayerPos) - Konstantinos - 14.09.2013

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
You can use the SetPlayerTeam); function. It disables friendly fire if 2 people are in the same team
Although, they can be killed with a knife.


Re: 2 quick questions. (NoDmg and SavePlayerPos) - Jason_Roul - 14.09.2013

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
If by that you require to save someone's position, you can do it like this

pawn Код:
//On top of your script, outside a callback
new Float:SaveX[MAX_PLAYERS], Float:SaveY[MAX_PLAYERS], Float:SaveZ[MAX_PLAYERS];

//Later on
stock SavePlayerPos(playerid)
{
GetPlayerPos(playerid, SaveX[playerid], SaveY[playerid], SaveZ[playerid];
return 1;
}
Their position will be saved in them values
But how will they spawn at the earlier location they spawned at when they connected before doing /jdm for example?