Author Topic: Spawnloc [ First Time Introduce In Pawn ]  (Read 2974 times)

0 Members and 1 Guest are viewing this topic.

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Spawnloc [ First Time Introduce In Pawn ]
« on: December 11, 2013, 01:01:34 am »
Beggining
Code: [Select]
new SpawnLoc[MAX_PLAYERS];
In OnPlayerSpawn

Code: [Select]
if (SpawnLoc[playerid] == 1) {
     new splitx[ 3 ][ 128 ], szMsg[128];
    format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
    split( dini_Get( file, "SpawnLoc" ), splitx, ' ' );
    SetPlayerPos( playerid, floatstr( splitx[ 0 ] ), floatstr( splitx[ 1 ] ), floatstr( splitx[ 2 ] ), 0, 0 );
    format( szMsg, sizeof( szMsg ), "Teleporting to SavedLocation" );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}

Now Commands

Code: [Select]
    else if ( strcmp( cmd, "spawnlocset", true ) == 0 )
{
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else
{
new szMsg[ 128 ], axcont[ 128 ], Float:x, Float:y, Float:z;
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );

  GetPlayerPos( playerid, x, y, z );

  format( axcont, 128, "%.5f %.5f %.5f", x, y, z );

dini_Create( file );
dini_Set( file, "Spawnloc", axcont );
   
SpawnLoc[playerid] = 1;   
   
format( szMsg, sizeof( szMsg ), "New Spawnloc Saved");
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
return 1;
    }
 else if ( strcmp( cmd, "spawnlocoff", true ) == 0 )
 {
 SpawnLoc[playerid] = 0;
 SendClientMessage(playerid,COLOR_RED," Your SpawnLoc Is Offline ");
 return 1;
 } 

Credits : Tutorial Of Gups & 70 % By Me!
I Hope You Like It!
Please Comment!
+1 If You Like it!
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol