Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- =================================
- Special Spawn Place By Shotyoudie
- =================================
- */
- #define FILTERSCRIPT
- #include <a_samp>
- #include <dini>
- #include <dudb>
- #define FILE_NAME "sspawn/%s.spwn"
- main() {}
- public OnFilterScriptInit()
- {
- print("\n+----------------------------------------+");
- print("|Special spawnplace by Shotyoudie loaded |");
- print("+----------------------------------------+\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n+------------------------------------------+");
- print("|Special spawnplace by Shotyoudie unloaded |");
- print("+------------------------------------------+\n");
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- new spawn[256], pname[24], Float:NewX, Float:NewY, Float:NewZ;
- GetPlayerName(playerid, pname, sizeof(pname));
- format(spawn, sizeof(spawn), FILE_NAME, udb_encode(pname));
- if(dini_Exists(spawn) == 1)
- {
- NewX = dini_Float(spawn, "X");
- NewY = dini_Float(spawn, "Y");
- NewZ = dini_Float(spawn, "Z");
- SetPlayerPos(playerid, NewX, NewY, NewZ);
- SendClientMessage(playerid, 0x0000CDAA,"Special spawn place loaded...");
- }
- else
- {
- SendClientMessage(playerid, 0x0000CDAA, "No special spawn place loaded, Your can save one with /savespawnp");
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/savespawnp", cmdtext, true, 10) == 0)
- {
- new make[256], pname[24], Float:LastX, Float:LastY, Float:LastZ;
- GetPlayerName(playerid, pname, sizeof(pname));
- format(make, sizeof(make), FILE_NAME, udb_encode(pname));
- dini_Create(make);
- GetPlayerPos(playerid, LastX, LastY, LastZ);
- dini_FloatSet(make, "X", LastX);
- dini_FloatSet(make, "Y", LastY);
- dini_FloatSet(make, "Z", LastZ);
- SendClientMessage(playerid, 0x0000CDAA,"Special spawn place saved!");
- return 1;
- }
- if (strcmp("/gotospawnp", cmdtext, true, 10) == 0)
- {
- new str1[256], pname[24];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(str1, sizeof(str1), FILE_NAME, udb_encode(pname));
- if (dini_Exists(str1))
- {
- new Float:GotoX, Float:GotoY, Float:GotoZ;
- GotoX = dini_Float(str1, "X");
- GotoY = dini_Float(str1, "Y");
- GotoZ = dini_Float(str1, "Z");
- SetPlayerPos(playerid,GotoX,GotoY,GotoZ);
- SendClientMessage(playerid, 0x0000CDAA,"Your teleported to your special spawn place");
- }
- else
- {
- SendClientMessage(playerid, 0x0000CDAA,"ERROR:File not found");
- }
- return 1;
- }
- if (strcmp("/delspawnp", cmdtext, true, 10) == 0)
- {
- new str1[256], pname[24];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(str1, sizeof(str1), FILE_NAME, udb_encode(pname));
- if (dini_Exists(str1))
- {
- dini_Remove(str1);
- SendClientMessage(playerid, 0x0000CDAA, "File succesfully removed!");
- }
- else
- {
- SendClientMessage(playerid, 0x0000CDAA,"ERROR:This file does not exists!");
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement