SA-MP Forums Archive
Re: Script Request Thread #3 - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Re: Script Request Thread #3 (/showthread.php?tid=90021)

Pages: 1 2 3 4 5 6 7 8 9


Re: Script Request Thread #3 - Correlli - 30.12.2009

Quote:
Originally Posted by Luka™
And yes I search for it already
It's a strange thing that you failed to find it.

Quote:
Originally Posted by Luka™
why you always said that?
Because you always ask for the things that can be easily found on this forum.


Re: Script Request Thread #3 - Luka P. - 30.12.2009

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Luka™
And yes I search for it already
It's a strange thing that you failed to find it.

Quote:
Originally Posted by Luka™
why you always said that?
Because you always ask for the things that can be easily found on this forum.
Yeah, I asked 2 things, GetIDFromName and this, can you say something else?


Re: Script Request Thread #3 - snabbo - 31.12.2009

Can someone does have mischien a script make that your score and money store?
therefore not with a register system if that is possible…
in advance thanks: D


Re: Re: Script Request Thread #3 - ded - 31.12.2009

Quote:
Originally Posted by snabbo
Can someone does have mischien a script make that your score and money store?
therefore not with a register system if that is possible…
in advance thanks: D
Translation:

Can somebody make me a script, that has the ability to store your score and money? Preferably without a login system, thanks in advance!


Re: Script Request Thread #3 - Hijolion - 01.01.2010

Can someone please make me a Score Saving System I don't know how to Use Dini or whatever


Re: Script Request Thread #3 - [03]Garsino - 01.01.2010

Quote:
Originally Posted by Skulls
Can someone please make me a Score Saving System I don't know how to Use Dini or whatever
working on it Skulls


Re: Script Request Thread #3 - Hijolion - 01.01.2010

Quote:
Originally Posted by [03
Garsino ]
Quote:
Originally Posted by Skulls
Can someone please make me a Score Saving System I don't know how to Use Dini or whatever
working on it Skulls
Yay !!!! Garsino !


Re: Re: Script Request Thread #3 - LarzI - 01.01.2010

Quote:
Originally Posted by snabbo
Can someone does have mischien a script make that your score and money store?
therefore not with a register system if that is possible…
in advance thanks: D
I'll get on with it right now :P


Re: Script Request Thread #3 - Vialpando - 01.01.2010

Im looking for a scripter. He should fix some lil bugs and should script rp systems in my gamemode. Will be payed through paypal around 30Ђ.
If interessted, message me.


Re: Script Request Thread #3 - ~Dangun! - 01.01.2010

I need to someone that can make me automatic login.

pawn Код:
#include <a_samp>
#include <dutils>
#include <dudb>
#include <dini>
#include <core>
#include <float>

////////////////////////////////////////////////////////////////////////////////

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

////////////////////////////////////////////////////////////////////////////////

forward UpdateStats();
forward OnPlayerRegister(playerid);
forward OnPlayerLogin(playerid);

////////////////////////////////////////////////////////////////////////////////

enum player_account_info
{
    logged,
    name[MAX_PLAYER_NAME],
    money,
    score,
    perfect,
    level,
}

new pInfo[MAX_PLAYERS][player_account_info];
new Kills[MAX_PLAYERS];

////////////////////////////////////////////////////////////////////////////////

public OnPlayerConnect(playerid)
{
  pInfo[playerid][logged] = 0;
  pInfo[playerid][level] = 0;
  pInfo[playerid][money] = 0;
  pInfo[playerid][score] = 0;
  pInfo[playerid][perfect] = 0;
    GetPlayerName(playerid,pInfo[playerid][name],128);
}
////////////////////////////////////////////////////////////////////////////////

public OnPlayerDisconnect(playerid, reason)
{


  pInfo[playerid][logged] = 0;
  pInfo[playerid][level] = 0;
  pInfo[playerid][money] = 0;
  pInfo[playerid][score] = 0;
  pInfo[playerid][perfect] = 0;

}
////////////////////////////////////////////////////////////////////////////////

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(login,5,cmdtext);
    dcmd(REGISTER,8,cmdtext);

////////////////////////////////////////////////////////////////////////////////

dcmd_login(playerid,params[])
{
    new string[265];
    new tmp[265];

    if(pInfo[playerid][logged] == 1)return SendMsg(playerid, 5000, "~r~Information: ~w~You are already ~r~logged~w~ in!");

  if(!strlen(params))return SendMsg(playerid, 5000, "~b~USAGE: ~w~/login [password]");

  if (dini_Exists(udb_encode(pInfo[playerid][name])))
  {
      tmp = dini_Get(udb_encode(pInfo[playerid][name]), "password");
    if (udb_hash(params) != strval(tmp))
    {
      SendMsg(playerid, 5000, "~r~Information: ~w~Wrong password!");
    }
    else
    {
        OnPlayerLogin(playerid);
    }
    }
    else
    {
    format(string, sizeof(string), "The Account %s does not exist in our Database yet, use /register password to register it!", pInfo[playerid][name]);
    SendMsg(playerid, 5000, string);
  }

  return 1;
}

dcmd_REGISTER(playerid,params[])
{
    new string[128];

    if(pInfo[playerid][logged] == 1)return SendMsg(playerid, 5000, "~r~Information: ~w~You are already logged in");
    if(!strlen(params))return SendMsg(playerid, 5000, "~r~Information:~w~ Use /register password");

  if (!dini_Exists(udb_encode(pInfo[playerid][name])))
  {
        format(string, sizeof(string), "The Account %s has been Succesfully registered! You have been automaticly logged in - Password: %s]", pInfo[playerid][name], params);
        SendClientMessage(playerid, COLOR_NOTICE, string);
        dini_Create(udb_encode(pInfo[playerid][name]));
        dini_IntSet(udb_encode(pInfo[playerid][name]), "password", udb_hash(params));
    OnPlayerRegister(playerid);
    OnPlayerLogin(playerid);
  }
  else
  {
    format(string, sizeof(string), "~r~Information: ~w~%s is already registered!", pInfo[playerid][name]);
    SendMsg(playerid, 5000, string);
  }

  return 1;
}

public OnPlayerLogin(playerid)
{
    new string[265];

    pInfo[playerid][logged] = 1;
    pInfo[playerid][money] = dini_Int(udb_encode(pInfo[playerid][name]), "money");
    pInfo[playerid][score] = dini_Int(udb_encode(pInfo[playerid][name]), "score");
    pInfo[playerid][level] = dini_Int(udb_encode(pInfo[playerid][name]), "level");
    pInfo[playerid][perfect] = dini_Int(udb_encode(pInfo[playerid][name]), "perfect");

  format(string, sizeof(string), "~r~Information: ~w~your now logged in! [~r~Score: ~w~%d] [~r~Admin Level: ~w~%d] [~r~Premium Member:~w~ %d] [~r~Money: ~w~%d]", pInfo[playerid][score], pInfo[playerid][level], pInfo[playerid][perfect], pInfo[playerid][money]);
    SendMsg(playerid, 5000, string);

    GivePlayerMoney(playerid,pInfo[playerid][money]);
    SetPlayerScore(playerid,pInfo[playerid][score]+GetPlayerScore(playerid));
}

////////////////////////////////////////////////////////////////////////////////

public OnPlayerRegister(playerid)
{
    dini_IntSet(udb_encode(pInfo[playerid][name]), "money", pInfo[playerid][money]);
    dini_IntSet(udb_encode(pInfo[playerid][name]), "score", pInfo[playerid][score]);
    dini_IntSet(udb_encode(pInfo[playerid][name]), "level", 0);
    dini_IntSet(udb_encode(pInfo[playerid][name]), "perfect", 0);
}

////////////////////////////////////////////////////////////////////////////////

public UpdateStats()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
      pInfo[i][money] = GetPlayerMoney(i);
        pInfo[i][score] = GetPlayerScore(i);

      if(pInfo[i][logged] == 1)
      {
        dini_IntSet(udb_encode(pInfo[i][name]), "perfect", pInfo[i][perfect]);
        dini_IntSet(udb_encode(pInfo[i][name]), "money", pInfo[i][money]);
        dini_IntSet(udb_encode(pInfo[i][name]), "score", pInfo[i][score]);
        dini_IntSet(udb_encode(pInfo[i][name]), "level", pInfo[i][level]);
        }
    }
}



Re: Re: Script Request Thread #3 - Hijolion - 04.01.2010

Quote:
Originally Posted by ♣ Joker ♠
pawn Код:
new Result;
pawn Код:
//OnGameModeInit
SetTimer("Question", 60_000, true);
pawn Код:
forward Question();
public Question()
{
    new
        string[26];
    string[0] = random(1000),
    string[1] = random(1000);
    Result = string[0] + string[1];
    format(string, sizeof string, "[QUESTION]: %3d + %3d = ?", string[0], string[1]);
    SendClientMessageToAll(0xFFFFFFAA, string);
}
pawn Код:
//OnPlayerText
if(Result)
    if(Result == strval(text))
    {
        GivePlayerWeapon(playerid, 27, 500);
        return (Result = 0);
    }
Thanks Joker


Re: Script Request Thread #3 - Zimon95 - 04.01.2010

Hello I need a /rob command only if the player is in a 24/7 and when a player robs all the players have to wait 1 hour to remake a rob. Thank you!


Re: Script Request Thread #3 - Hijolion - 04.01.2010

Quote:
Originally Posted by Zimon95
Hello I need a /rob command only if the player is in a 24/7 and when a player robs all the players have to wait 1 hour to remake a rob. Thank you!
pawn Код:
dcmd_rob(playerid, params[])
{
new userid, string[128], targetsname[MAX_PLAYER_NAME], money, muggersname[MAX_PLAYER_NAME];
if (sscanf(params, "u", userid)) SendClientMessage(playerid, COLOR_WHITE, "SYNTAX - /mask [playerid]");
else
{
if(IsPlayerConnected(userid))
{
GetPlayerMoney(userid);

if(GetDistanceBetweenPlayers(playerid, userid) > 3)
{
  SendClientMessage(playerid, COLOR_WHITE, "You're not close enough.");
  return 1;
}
if(money < 0)
{
  SendClientMessage(playerid, COLOR_WHITE, "That player doesn't have enough money to rob from. (0)");
  return 1;
}

GetPlayerName(playerid, muggersname, sizeof(muggersname));
GetPlayerName(userid, targetsname, sizeof(targetsname));

format(string, sizeof(string), "You have robbed $%d, from %s.", money, targetsname);
SendClientMessage(playerid, COLOR_WHITE, string);

format(string, sizeof(string), "You have been 'mugged'! You have lost $%d, %s stole it.", money, muggersname);
SendClientMessage(playerid, COLOR_WHITE, string);

GivePlayerMoney(playerid, money);
}
}
return 1;



Re: Script Request Thread #3 - Guso - 05.01.2010

Thanks Corelli!
I've just learned a new thing today


Re: Script Request Thread #3 - Correlli - 05.01.2010

Quote:
Originally Posted by Guso
Since i don't know how to get a actual cars position
https://sampwiki.blast.hk/wiki/GetVehiclePos


Re: Script Request Thread #3 - [03]Garsino - 05.01.2010

I need a /carwhisper (/cw) command. It will only send the message to players in the same car as you.

If someone could make this they would get a cookie


Re: Re: Script Request Thread #3 - dugi - 05.01.2010

Script Request thread #4 is available at: http://forum.sa-mp.com/index.php?topic=144062.0