Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This filterscript is copyright to Chaosnz
- // You are free to edit this filterscript but please DO NOT remove the credits.
- #include <a_samp>
- #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- #define COLOR_GREY 0xAFAFAFAA
- new MobSpawn[MAX_PLAYERS];
- new deathobject;
- new Float: storX, Float: storY, Float: storZ, Float: storA, Float: storI;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Mobile Spawn System by Chaosnz");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- MobSpawn[playerid] = 0;
- SendClientMessage(playerid,COLOR_GREY,"This Server is using the Mobile Spawn System by Chaosnz. /mshelp");
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(MobSpawn[playerid] == 1)
- {
- SetPlayerPos(playerid, storX, storY, storZ);
- SetPlayerFacingAngle(playerid,storA);
- SetPlayerInterior(playerid,storI);
- SendClientMessage(playerid,COLOR_GREY,"You have spawned at your Mobile Spawn Point");
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SendClientMessage(playerid,COLOR_GREY,"Did you know, you can place a Mobile Spawn Point? /mshelp");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- dcmd(mshelp,6, cmdtext);
- dcmd(mspawn,6, cmdtext);
- dcmd(gotomsp,7,cmdtext);
- dcmd(removems,8,cmdtext);
- return 0;
- }
- dcmd_mshelp(playerid, params[])
- {
- #pragma unused params
- SendClientMessage(playerid,COLOR_GREY,"Mobile Spawn Help");
- SendClientMessage(playerid,COLOR_GREY,"With this command you can set up your OWN spawnpoint anywhere on the map.");
- SendClientMessage(playerid,COLOR_GREY,"To do this, type /mspawn to spawn where you want");
- SendClientMessage(playerid,COLOR_GREY,"When you type the above command, you will see a object marking your spawn position.");
- SendClientMessage(playerid,COLOR_GREY,"To remove the mobile spawn, type /removems");
- SendClientMessage(playerid,COLOR_GREY,"You can goto your Mobile Spawn Point by typing /gotomsp");
- return 1;
- }
- dcmd_mspawn(playerid, params[])
- {
- #pragma unused params
- SendClientMessage(playerid,COLOR_GREY,"Mobile Spawn Placed");
- GetPlayerPos(playerid, storX, storY, storZ);
- GetPlayerFacingAngle(playerid, storA);
- storI = GetPlayerInterior(playerid);
- deathobject = CreateObject(2976, storX, storY, storZ+1,0,0,0,500);
- MobSpawn[playerid] = 1;
- return 1;
- }
- dcmd_removems(playerid, params[])
- {
- #pragma unused params
- SendClientMessage(playerid,COLOR_GREY,"Mobile Spawn Disabled");
- DestroyObject(deathobject);
- MobSpawn[playerid] = 0;
- return 1;
- }
- dcmd_gotomsp(playerid, params[])
- {
- #pragma unused params
- if(MobSpawn[playerid] == 1)
- {
- SendClientMessage(playerid,COLOR_GREY,"You have teleported to your Mobile Spawn.");
- SetPlayerPos(playerid, storX, storY, storZ);
- SetPlayerFacingAngle(playerid, storA);
- SetPlayerInterior(playerid, storI);
- }
- else
- {
- SendClientMessage(playerid,COLOR_GREY,"You need to create your Mobile Spawn first. /mspawn");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment