30.10.2012, 20:28
When I type /slenderon, everything works, it's just that the object will not show up behind my player. Also, could someone add where every 3 seconds the object is destroyed but gets created again, with the players new position? Thanks.
CODE:
CODE:
Код:
#include <a_samp> #include <zcmd> #define FILTERSCRIPT #define COLOR_RED 0xFF0000C8 new object; new Float:pCoo[3]; new SwitchPlayerTimer_; new DestroyObjectTimer1_; forward DestroyObjectTimer(); forward SwitchPlayer(playerid); forward SwitchPlayerTimer(); forward DestroyObjectTimer1(); public OnFilterScriptInit() { print("______________________________________________________________________________"); print("|"); print("NoahF's Slender FilterScript has successfully loaded! Beware of Slender.."); print("|"); print("______________________________________________________________________________"); return 1; } public OnFilterScriptExit() { print("______________________________________________________________________________"); print("|"); print("NoahF's Slender FilterScript has successfully loaded! Beware of Slender.."); print("|"); print("______________________________________________________________________________"); return 1; } public DestroyObjectTimer1() { DestroyObject(object); return 1; } public SwitchPlayer(playerid) { SelectRandomPlayer(); GetPlayerPos(playerid, pCoo[0],pCoo[1],pCoo[2]); object = CreateObject(2589, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToPlayer(object, playerid, 10.0, 10.0, 1.5, 0.0, 0.0, 0.0); DestroyObjectTimer1_=SetTimer("DestroyObjectTimer1", 5000, true); SwitchPlayerTimer_=SetTimer("SwitchPlayerTimer", 183333, true); return 1; } public SwitchPlayerTimer() { SelectRandomPlayer(); return 1; } stock SelectRandomPlayer() { new r = random(MAX_PLAYERS); if(IsPlayerConnected®) { return r; } else { SelectRandomPlayer(); } return 1; } COMMAND:slenderon(playerid, params[]) { #pragma unused params if(IsPlayerAdmin(playerid)) { SendClientMessage(playerid,COLOR_RED, "Slender mode ON! You better start running, and don't look behind you! :)"); SelectRandomPlayer(); SendClientMessageToAll(COLOR_RED, "Slender Mode has been Activated for everyone. Always look behind you.."); for(new i = 0; i < MAX_PLAYERS; i++) { PlayAudioStreamForPlayer(playerid, "http://soundcloud.com/noahfallon/slender-music-40-minutes-long/download"); return 1; } } return 1; } COMMAND:slenderoff(playerid, params[]) { #pragma unused params if(IsPlayerAdmin(playerid)) { SendClientMessage(playerid,COLOR_RED, "Slender mode OFF! You are safe now! :)"); DestroyObject(object); KillTimer(SwitchPlayerTimer_); KillTimer(DestroyObjectTimer1_); for(new i = 0; i < MAX_PLAYERS; i++) { StopAudioStreamForPlayer(playerid); return 1; } } return 1; }