[FilterScript] IG Spawn Location Changing.
#1

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.
Reply
#2

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
Reply
#3

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.
Reply
#4

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;
Reply
#5

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

nice work mate
Reply
#7

Thanks.
Reply
#8

People, Y Uno Comment?!
Reply
#9

Nice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)