[Q] Incognito's streamer: Add/Remove Player + Update(Ex) - 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: [Q] Incognito's streamer: Add/Remove Player + Update(Ex) (
/showthread.php?tid=296687)
[Q] Incognito's streamer: Add/Remove Player + Update(Ex) -
Kwarde - 12.11.2011
Hello.
I am trying to make a synch/desynch command for my assassin's creed SAMP server. The desynching is working, but the synch doesn't. Does anyone knows how this works?
So the problem is: I'm not able to update a player anymore: After using "Streamer_RemovePlayer" the streaming for that player is permanently (untill relog/restart) stopped. Even after using "Streamer_AddPlayer" and the "Update" and "UpdateEx" the player doesn't get an update for the streaming :S
Here's the script:
pawn Код:
CMD:togsynch(playerid, params[])
{
new id;
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GRAY, "* You're not authorized to use this command.");
if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /togsynch [playerid]");
id = strval(params);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "* That player isn't connected to the server!");
if(PlayerInfo[id][pSynched])
{
PlayerInfo[id][pSynched] = false;
Streamer_RemovePlayer(id);
SendClientMessage(id, COLOR_RED, "[ANIMUS ERROR] You have been desynched!");
SendAdmMsg(true, COLOR_YELLOW, false, 666, "* %s(%d) has desynched %s(%d)!", PlayerName[playerid], playerid, PlayerName[id], id);
}
else
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(id, X, Y, Z);
PlayerInfo[id][pSynched] = true;
Streamer_AddPlayer(id);
Streamer_UpdateEx(id, X, Y, Z);
Streamer_Update(id);
SendClientMessage(id, COLOR_GREEN, "[ANIMUS MESSAGE] You have been synched!");
SendAdmMsg(true, COLOR_YELLOW, false, 666, "* %s(%d) has synched %s(%d)!", PlayerName[playerid], playerid, PlayerName[id], id);
}
return 1;
}
If you can help me: Thanks. Otherwise, if you tried to help me but if it didn't work, still thanks :P
- Kevin
Re: [Q] Incognito's streamer: Add/Remove Player + Update(Ex) -
Kwarde - 13.11.2011
Yet not fixed, this post is at page 4/5 atm, so I am bumping it if you don't mind :P. I'd rather use this because for the gamemode: If you fail to do a mission I want the desynch function (It's currently in the function for debug testing).
- Kevin