SetPlayerKills and SetPlayerDeaths
#7

I use this, now I am confused
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new file[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
//save the name of your folder in scriptfiles
    format(file, sizeof(file), "\\Save\\%s.ini", pname);
    if(!dini_Exists(file))
        dini_Create(file);
    dini_IntSet(file, "skin", GetPlayerSkin(playerid));
    dini_IntSet(file, "score", GetPlayerScore(playerid));
    dini_IntSet(file, "color", GetPlayerColor(playerid));
    KillTimer(timer);
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) {                   //Checks if the player that just spawned is an NPC.
        new npcname[MAX_PLAYER_NAME];
//Getting the NPC's name.
        GetPlayerName(playerid, npcname, sizeof(npcname));
                                                  //Checking if the NPC's name is Taxi_Driver
        if(!strcmp(npcname, "Taxi_Driver", true)) {
//Putting the NPC into the vehicle we created for it.
            PutPlayerInVehicle(playerid, Taxi_DriverVehicle, 0);
            SetPlayerSkin(playerid,141);
            SetPlayerColor(playerid,COLOR_YELLOW);
        }
                                                  //Checking if the NPC's name is Harry_Potter
        if(!strcmp(npcname, "Harry_Potter", true)) {
//Putting the NPC into the vehicle we created for it.
            PutPlayerInVehicle(playerid, Harry_PotterVehicle, 0);
            SetPlayerSkin(playerid,147);
            SetPlayerColor(playerid,COLOR_WHITE);
        }
        return 1;
    }
    SetPlayerInterior(playerid,0);
    SetPlayerRandomSpawn(playerid);
    GivePlayerWeapon(playerid, 24, 999);
    GivePlayerWeapon(playerid, 26, 999);
    GivePlayerWeapon(playerid, 21, 999);
    GivePlayerMoney(playerid, 50000);
    new file[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "\\Save\\%s.ini", pname);
    if(dini_Exists(file)) {
        SetTimerEx("SpawnSave", 10, false, "d", playerid);
    }
    return 1;
}
pawn Код:
forward SpawnSave(playerid);
public SpawnSave(playerid)
{
    new file[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "\\Save\\%s.ini", pname);
    SetPlayerSkin(playerid, dini_Int(file, "skin"));
    SetPlayerScore(playerid, dini_Int(file, "score"));
    SetPlayerColor(playerid, dini_Int(file, "color"));
    return 1;
}
So where to put it
Reply


Messages In This Thread
SetPlayerKills and SetPlayerDeaths - by Kostas' - 14.10.2011, 12:18
Re: SetPlayerKills and SetPlayerDeaths - by sleepysnowflake - 14.10.2011, 12:22
Re: SetPlayerKills and SetPlayerDeaths - by Kostas' - 14.10.2011, 12:54
Re: SetPlayerKills and SetPlayerDeaths - by Yamoo - 14.10.2011, 14:29
Re: SetPlayerKills and SetPlayerDeaths - by Kostas' - 14.10.2011, 14:38
Re: SetPlayerKills and SetPlayerDeaths - by Yamoo - 14.10.2011, 14:50
Re: SetPlayerKills and SetPlayerDeaths - by Kostas' - 14.10.2011, 15:23
Re: SetPlayerKills and SetPlayerDeaths - by Kostas' - 14.10.2011, 16:24
Re: SetPlayerKills and SetPlayerDeaths - by SmiT - 14.10.2011, 16:30
Re: SetPlayerKills and SetPlayerDeaths - by Kostas' - 14.10.2011, 16:38

Forum Jump:


Users browsing this thread: 1 Guest(s)