Error's
#19

try this in a new script and if work replace with your script
pawn Code:
//Credits to SAMP using this
#include <a_samp>
//Credits to Dracoblue for dini
#include <dini>

#define CIV 0
#define YOUR_TEA_NAME_2 1
//Add more for others team..

#define SAVE_SKIN true // true for saving skin, false for not

 new Float:x, Float:y, Float:z;
new Float:Angle;
new gTeam[MAX_PLAYERS];
new bool: SaveSkin[MAX_PLAYERS];

new skin;

#define PlayerFile "Players/%s.ini" // replace Account with name of your folder

///deleting the Loose identitation wra
#pragma tabsize 0

public OnPlayerConnect(playerid)
{
         new name[MAX_PLAYER_NAME], file[256];
         GetPlayerName(playerid,name,sizeof(name));
         format(file,sizeof(file),PlayerFile,name);
         
         GetPlayerPos(playerid, x, y, z);
         GetPlayerFacingAngle(playerid,Angle);
         
         
         if(!dini_Exists(file) )
         {
                //setting team to 0 (civil) if not exist file
                gTeam[playerid] = CIV;
                dini_Create(file);
                dini_Set(file,"Name",name);
                dini_FloatSet(file,"X",0);
                dini_FloatSet(file,"Y",0);
                dini_FloatSet(file,"Z",0);
                dini_FloatSet(file,"Z",0);
                dini_IntSet(file,"Team",0);
                if(SaveSkin[playerid] == SAVE_SKIN)
                {
                         dini_IntSet(file,"Skin",-1);
                }
                                              else if(Saveskin[playerid] == false) return 0;
         }
}

public OnPlayerDisconnect(playerid,reason)
{

                 new name[MAX_PLAYER_NAME], file[256];
         GetPlayerName(playerid,name,sizeof(name));
         format(file,sizeof(file),PlayerFile,name);

         GetPlayerPos(playerid, x, y, z);
         GetPlayerFacingAngle(playerid,Angle);
         
                skin = GetPlayerSkin(playerid);
               
                if(SaveSkin[playerid] == SAVE_SKIN)
                {
                         dini_IntSet(file,"Skin",skin);
                         dini_FloatSet(file,"X",x);
                         dini_FloatSet(file,"Y",y);
                         dini_FloatSet(file,"Z",z);
                         dini_FloatSet(file,"Angle",Angle);
                         dini_IntSet(file,"Team",gTeam[playerid]);
                }
                                                 else if(Saveskin[playerid] == false) return 0;
   return 1;
}

public OnPlayerSpawn(playerid)
{
             new name[MAX_PLAYER_NAME], file[256];
         GetPlayerName(playerid,name,sizeof(name));
         format(file,sizeof(file),PlayerFile,name);
         
                if(SaveSkin[playerid] == SAVE_SKIN)
                {
                        SetPlayerSkin(playerid,dini_Int(file,"Skin"));
                }
                                             else if(Saveskin[playerid] == false) return 0;
               if(dini_Exists(file) )
               {
                    gTeam[playerid] = dini_Int(file,"Team");
                    SetPlayerPos(playerid,dini_Float(file,"X"),dini_Float(file,"Y"),dini_Float(file,"Z"));
                    SetPlayerFacingAngle(playerid,dini_Float(file,"Angle"));
               }
   return 1;
}
Reply


Messages In This Thread
Error's - by ZBits - 18.07.2012, 03:30
Re: Error's - by ViniBorn - 18.07.2012, 03:32
Re: Error's - by ZBits - 18.07.2012, 03:33
Re: Error's - by ViniBorn - 18.07.2012, 03:34
Re: Error's - by ZBits - 18.07.2012, 03:40
Re: Error's - by ZBits - 18.07.2012, 03:46
Re: Error's - by Larceny - 18.07.2012, 03:51
Re: Error's - by ZBits - 18.07.2012, 03:56
Re: Error's - by Larceny - 18.07.2012, 03:58
Re: Error's - by ZBits - 18.07.2012, 04:03
Re: Error's - by Larceny - 18.07.2012, 04:12
Re: Error's - by ZBits - 18.07.2012, 04:49
Re: Error's - by ZBits - 18.07.2012, 05:52
Re: Error's - by Andi_Evandy - 18.07.2012, 06:42
Re: Error's - by ZBits - 18.07.2012, 14:07
Re: Error's - by Andi_Evandy - 18.07.2012, 14:56
Re: Error's - by XStormiest - 18.07.2012, 15:13
Re: Error's - by ZBits - 18.07.2012, 15:34
Re: Error's - by XStormiest - 18.07.2012, 15:49
Re: Error's - by ZBits - 18.07.2012, 15:55

Forum Jump:


Users browsing this thread: 1 Guest(s)