SA-MP Forums Archive
[FilterScript] IG Spawn Location Changing. - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] IG Spawn Location Changing. (/showthread.php?tid=349487)



IG Spawn Location Changing. - Littlehelper - 09.06.2012

Hello,
I Was Bored This Morning So I Decided To Create Something Simple And I Created IG Spawn Location Changing System Which I, Myself Wont Be Using It So Released It For The Community.

Pastebin.
pawn Код:
// Dynamic I-G Spawn Location Changing System By Littlehelper[MDZ].
// Please Donot Remove The Credits And/Or Redistribute This As Your Own!
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

new
    Float:CurrentSpawn[3];
new
    Float:CurrentFA[1];
   
#define DIALOG_SPAWN 999

public OnFilterScriptInit()
{
    print("\n-----------------------------------------------------");
    print("IG Spawn Location Changing By Littlehelper[MDZ] Loaded");
    print("--------------------------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendClientMessageToAll(-1,"Server Using 'IG Spawn Location Changing' By Littlehelper[MDZ]");
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}
public OnPlayerSpawn(playerid)
{
    SendClientMessage(playerid,-1,"Type /NewSpawn To Change Your Spawn Location");
    SetPlayerPos(playerid,CurrentSpawn[0],CurrentSpawn[1],CurrentSpawn[2]);
    SetPlayerFacingAngle(playerid,CurrentFA[0]);
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new Float:X,Float:Y,Float:Z,Float:FA,String[128],pName[128];
    if(dialogid == DIALOG_SPAWN)
    {
        if(!response) return TogglePlayerControllable(playerid,true);
        GetPlayerPos(playerid,X,Y,Z);
        GetPlayerFacingAngle(playerid,FA);
        CurrentSpawn[0] = Float:X;
        CurrentSpawn[1] = Float:Y;
        CurrentSpawn[2] = Float:Z;
        CurrentFA[0] = Float:FA;
        TogglePlayerControllable(playerid,true);
        GetPlayerName(playerid,pName,sizeof(pName));
        format(String,sizeof(String),"Spawn Location Has Been Changed By Administrator %s",pName);
        SendClientMessageToAll(-1,String);
        SendClientMessage(playerid,-1,"Spawning Area Has Been Changed Successfully!");
    }
    return 0;
}

CMD:kill(playerid,params[])
{
SpawnPlayer(playerid);
return 1;
}

CMD:newspawn(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You Are Not Authorized To Use This Command!"); // You Can Remove This If You Dont Want Only Administrators To Use This Command.
TogglePlayerControllable(playerid,false);
ShowPlayerDialog(playerid,DIALOG_SPAWN,DIALOG_STYLE_MSGBOX,"{FFAF00}:: {FFFFFF}Dynamic Spawn Changing","{FFFFFF}Are You Sure You Want To Change The Spawn Area To This Place?","Yes","No");
return 1;
}
And Thats It.
Don't Remove The Credits And Keep It Clean
PS: Rate Please.


Re: IG Spawn Location Changing. - Niko_boy - 09.06.2012

nice but most of server uses a random spawn system that is there are many Spawn Places more than 1
though it can be like /teletoadminpos [someshorter]
good


Re: IG Spawn Location Changing. - Littlehelper - 09.06.2012

Quote:
Originally Posted by Niko_boy
Посмотреть сообщение
nice but most of server uses a random spawn system that is there are many Spawn Places more than 1
though it can be like /teletoadminpos [someshorter]
good
Thats a nice idea.
Thanks.


Re: IG Spawn Location Changing. - Patrik356b - 09.06.2012

Why is Float:CurrentFA[] an array when you only storing one single thing in it?.

It would be better to just do: new Float:CurrentFA;


Re: IG Spawn Location Changing. - Littlehelper - 09.06.2012

I tried but it didnt worked out.
However, you are allowed to change it to your needs as long as you keep credits.
Thanks.


Re: IG Spawn Location Changing. - Hardcore TDM - 09.06.2012

nice work mate


Re: IG Spawn Location Changing. - Littlehelper - 09.06.2012

Thanks.


Re: IG Spawn Location Changing. - Littlehelper - 10.06.2012

People, Y Uno Comment?!


Re: IG Spawn Location Changing. - Lorenzo! - 15.08.2012

Nice