How to Create?
#1

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
Reply
#2

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.
Reply
#3

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;
}
Reply
#4

Below if(!dini_Exists(file))

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

Thanks i will try
Reply
#6

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
Reply
#7

Any anti-cheat ?
Reply
#8

No i dont have
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)