Help me!!
#1

Some one help me,
I am trying to add some filterscript on volt host, when I add the name of filterscript on server.cfg file then I try to restart the server, server gone stopped.
That filterscript is completely working on my home server.

the code of the filterscript is:


Код:
#include <a_samp>
#include <dudb>

public OnGameModeInit() SendRconCommand("exit");
public OnPlayerSpawn(playerid) LoadWeapons(playerid);
public OnFilterScriptInit() printf("Weaponsave FS loaded!");
public OnPlayerDisconnect(playerid, reason) SaveWeapons(playerid);

stock LoadWeapons(playerid)
{
    new pname[MAX_PLAYER_NAME];
    if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
    if(!udb_Exists(pname)) udb_Create(pname, "");
    for(new wep[8], amm[6], i; i < 13; i++)
    {
        format(amm, sizeof amm, "Ammo%d", i);
        format(wep, sizeof wep, "Weapon%d", i);
        GivePlayerWeapon(playerid, dUserINT(pname).(wep), dUserINT(pname).(amm));
    }
    return true;
}

stock SaveWeapons(playerid)
{
    new pname[MAX_PLAYER_NAME];
    if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
    if(!udb_Exists(pname)) udb_Create(pname, "");
    for(new wep[8], amm[6], i, cwep, camm; i < 13; i++)
    {
        format(amm, sizeof amm, "Ammo%d", i);
        format(wep, sizeof wep, "Weapon%d", i); 
        GetPlayerWeaponData(playerid, i, cwep, camm);
        dUserSetINT(pname).(amm, camm);
        dUserSetINT(pname).(wep, cwep);
    }
    return true;
}
I would appreciate the help.
Reply
#2

public OnGameModeInit() SendRconCommand("exit");



remove that line
Reply
#3

pawn Код:
#include <a_samp>
#include <dudb>

public OnPlayerSpawn(playerid)
{
LoadWeapons(playerid);
return 1;
}

public OnFilterScriptInit()
{
printf("Weaponsave FS loaded!");
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
SaveWeapons(playerid);
}

stock LoadWeapons(playerid)
{
    new pname[MAX_PLAYER_NAME];
    if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
    if(!udb_Exists(pname)) udb_Create(pname, "");
    for(new wep[8], amm[6], i; i < 13; i++)
    {
        format(amm, sizeof amm, "Ammo%d", i);
        format(wep, sizeof wep, "Weapon%d", i);
        GivePlayerWeapon(playerid, dUserINT(pname).(wep), dUserINT(pname).(amm));
    }
    return 1;
}

stock SaveWeapons(playerid)
{
    new pname[MAX_PLAYER_NAME];
    if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
    if(!udb_Exists(pname)) udb_Create(pname, "");
    for(new wep[8], amm[6], i, cwep, camm; i < 13; i++)
    {
        format(amm, sizeof amm, "Ammo%d", i);
        format(wep, sizeof wep, "Weapon%d", i);
        GetPlayerWeaponData(playerid, i, cwep, camm);
        dUserSetINT(pname).(amm, camm);
        dUserSetINT(pname).(wep, cwep);
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by xkirill
Посмотреть сообщение
pawn Код:
#include <a_samp>
#include <dudb>

public OnPlayerSpawn(playerid)
{
LoadWeapons(playerid);
return 1;
}

public OnFilterScriptInit()
{
printf("Weaponsave FS loaded!");
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
SaveWeapons(playerid);
}

stock LoadWeapons(playerid)
{
    new pname[MAX_PLAYER_NAME];
    if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
    if(!udb_Exists(pname)) udb_Create(pname, "");
    for(new wep[8], amm[6], i; i < 13; i++)
    {
        format(amm, sizeof amm, "Ammo%d", i);
        format(wep, sizeof wep, "Weapon%d", i);
        GivePlayerWeapon(playerid, dUserINT(pname).(wep), dUserINT(pname).(amm));
    }
    return 1;
}

stock SaveWeapons(playerid)
{
    new pname[MAX_PLAYER_NAME];
    if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
    if(!udb_Exists(pname)) udb_Create(pname, "");
    for(new wep[8], amm[6], i, cwep, camm; i < 13; i++)
    {
        format(amm, sizeof amm, "Ammo%d", i);
        format(wep, sizeof wep, "Weapon%d", i);
        GetPlayerWeaponData(playerid, i, cwep, camm);
        dUserSetINT(pname).(amm, camm);
        dUserSetINT(pname).(wep, cwep);
    }
    return 1;
}
I am using that filterscript but weapons not svae when we log from the server.
Help me.
Reply
#5

use y_ini
its alot easier
Reply
#6

Can you make weapon save filterscript with y_ini?

I appreciate your help.

Please.
Reply
#7

Take the one in my signature for example. Try to make that one bigger.
Reply
#8

Can any one of you make a weapon save filterscript, Please!!
Reply
#9

Can you please stop talking like "plz, make this, pleasz, man plezz". How about starting from scratch and reading tutorials and the wiki?
Reply
#10

Quote:
Originally Posted by umarmalik
Посмотреть сообщение
Can any one of you make a weapon save filterscript, Please!!
https://sampforum.blast.hk/showthread.php?tid=187229
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)