SA-MP Forums Archive
How to Create? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to Create? (/showthread.php?tid=393163)



How to Create? - Yordan_Kronos - 17.11.2012

I have problem. When somebody regsiter in my server and he start with 0 Money .. how can i change this to start with example 300 ?? and how can i do .. to save last position when player Disconnect from server. Thanks


Re: How to Create? - Konstantinos - 17.11.2012

On the register part, use
pawn Код:
GivePlayerMoney( playerid, 300 );
About saving the last position when a player disconnects from the server, it depends on what you're using to save the rest of data.


Re: How to Create? - Yordan_Kronos - 17.11.2012

When i have to post GivePlayerMoney ?

pawn Код:
public OnPlayerSpawn(playerid)
{
    // Anti F4 Bug - Logging/Registering
    if(!PlayerInfo[playerid][pLoggedIn] && !IsPlayerNPC(playerid))
    {
        if(IsPlayerNPC(playerid)) return 1;
        SetPlayerPos(playerid, 1975.203002, 3779.311523, -50.243506);
        SetPlayerCameraPos(playerid, 1975.203002, 3779.311523, 100.243506);
        SetPlayerCameraLookAt(playerid, 1975.203002, 3779.311523, -0.243506);
        SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        new file[64];
        format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
        // Player isn't banned
        if(dini_Int(file, "AdminAccount") == 1)
        {
            format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
            SetPlayerName(playerid, dini_Get(file, "OldName"));
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            ShowDialog(playerid, 2);
        }
        if(!dini_Exists(file))
        {
            ShowDialog(playerid, 1);
            return 1;
        }
        else
        {
            ShowDialog(playerid, 2);
        }
        return 1;
    }
    // Actual Spawning
    ResetPlayerWeapons(playerid);
    if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
    {
      new npcname[MAX_PLAYER_NAME];
      GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
      if(!strcmp(npcname, "BusDriver", true)) //Checking if the NPC's name is BusDriver
      {
        PutPlayerInVehicle(playerid, NPCBus, 0); //Putting the NPC into the vehicle we created for it.
        return 1;
      }
      return 1;
    }
    if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
    {
        FalseBan[playerid] = 0;
        SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
        SpawnChar(playerid);
    }
    return 1;
}



AW: How to Create? - Skimmer - 17.11.2012

Below if(!dini_Exists(file))

pawn Код:
if(!dini_Exists(file))
{
    ShowDialog(playerid, 1);
    GivePlayerMoney(playerid, 500);
}



Re: How to Create? - Yordan_Kronos - 17.11.2012

Thanks i will try


Re: How to Create? - Yordan_Kronos - 17.11.2012

When i register and this show me that i have $500 only for 1 seconds and after this they are ;; 500-400-300-200-100-0 again


Re: How to Create? - Konstantinos - 17.11.2012

Any anti-cheat ?


Re: How to Create? - Yordan_Kronos - 17.11.2012

No i dont have


Re: How to Create? - Face9000 - 17.11.2012

Show us the ShowDialog(playerid, 1); part, probably this is the Dialog ID 1, show us.


Re: How to Create? - Yordan_Kronos - 17.11.2012

I fix it problem is other.. and second how can i save my last position ? i use dini ?