Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Fjose

#76
Snippet Showroom / Re: Team System
Oct 27, 2014, 04:07 PM
ok thanks honey,

rarely.. I never had a problem with the FindPlr
#77
Snippet Showroom / Re: Team System
Oct 27, 2014, 03:09 PM
I think it I have the solution but first.

post the line 912 of onplayercommand and the 289 of gettok.

note: are you sure that you have added the timerequest as is written? post your class too. maybe the error is in the class
#78
Snippet Showroom / Re: Team System
Oct 26, 2014, 03:58 PM
date() gets the current date.
time() gets the date since 1970.

In this case if I'm using a code such: pinfo[ player.ID ].TimeRequest = time() + 30;
I'm adding 30 seconds to the current time.

and then in this line:
else if ( pinfo[ player.ID ].TimeRequest < time() ) { PrivMessage( player, "[Error] Time ended." ); pinfo[ player.ID ].Request = false; pinfo[ player.ID ].Partner = null; pinfo[ plr.ID ].Request = false; pinfo[ plr.ID ].Partner = null; }
I'm confirming if the time request is minor than the current time.

Scripts Updated.
#79
Snippet Showroom / Re: Team System
Oct 26, 2014, 03:03 PM
Quote from: KraTO$ on Oct 26, 2014, 02:57 PMThat only gives me Error...IDK Why!!!!

:/ are you using the cmd "team" right? or the error is with other cmd?
#80
Snippet Showroom / Re: Team System
Oct 26, 2014, 02:52 PM
Quote from: KraTO$ on Oct 26, 2014, 02:47 PMBrother ..
time() gets an error (attempt to call 'integer')

I'm using the time() in all script, can be more specific?
#81
Snippet Showroom / Re: Team System
Oct 26, 2014, 01:34 PM
Quote from: KraTO$ on Oct 26, 2014, 01:00 PMNot Working for me!!!!

What's the line? where you have the error.
#82
oh. anyway there is no other way to modify player speed?
#83
wiki is not 100% updated for that, there are some issues..

what is the true function for set the speed individually?
#84
All plugins are located on same folder, I've checked the name and is correct.



The other error was with this:
Quoteif ( !IsNum( text ) ) aMsg( id, "Invalid vehicle id." )
the function "IsNum" was not added on the plugin's inside (squirrel plugin)
 
#85
Quote from: stormeus on Oct 22, 2014, 11:54 PM
Quote from: Fjose on Oct 22, 2014, 11:10 PMtesters and developers can't tell me about the multiple instances?

It's simply a matter of launching a VC:MP instance, changing your name in the browser, and then launching another VC:MP instance. That's it.

Thanks :)

the last question to lock this topic.
I have the plugin sdk now just I need a program for can compile a module. some suggestions?
#86
testers and developers can't tell me about the multiple instances?


#87
Snippet Showroom / Team System v1.0.2
Oct 21, 2014, 03:16 AM
Player Team System

Functions:
Class PlayerInfo {
Team = false;
Request = false;
TimeRequest = 0;
Partner = null;
}

function onScriptLoad()
{
    pinfo <- array( GetMaxPlayers(), null );
}

function onPlayerJoin( player )
{
    pinfo[ player.ID ] = PlayerInfo();
}

function onPlayerSpawn( player )
{
if ( pinfo[ player.ID ].Team == true )
{
local plr = FindPlayer( pinfo[ player.ID ].Partner );
if ( plr ) player.Pos = plr.Pos;
}
}

function onPlayerPart( player, reason )
{
if ( pinfo[ player.ID ].Team == true )
{
local plr = FindPlayer( pinfo[ player.ID ].Partner );
if ( plr ) {
PrivMessage( plr, "[!] " + player.Name + " left the team." );
pinfo[ plr.ID ].Partner = null;
pinfo[ plr.ID ].Team = false;
}
}
pinfo[ player.ID ] = null;
}

function onPlayerSpawn( player )
{
 if ( pinfo[ player.ID ].Team == true )
 {
  local plr = FindPlayer( pinfo[ player.ID ].Partner );
  if ( plr ) player.Pos = plr.Pos;
 }
}

GetTok and NumTok: there are two versions. use whatever you want.
// Version no.1
function GetTok(string, separator, n, ...)
{
local m = vargv.len() > 0 ? vargv[0] : n,
  tokenized = split(string, separator),
  text = "";

if (n > tokenized.len() || n < 1) return null;
for (; n <= m; n++)
{
text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
}
return text;
}

function NumTok(string, separator)
{
local tokenized = split(string, separator);
return tokenized.len();
}

// Version no.2
function GetTok(str, sep, pos, len = null)
{
 if (typeof str != "string" || str.len() < 1) return "";
 else if (typeof sep != "string" || sep.len() < 1) return "";
 local tok = split(str, sep);
 if (typeof tok != "array") return str;
 else if (tok.len() == 1 && tok[0] == str) return tok[0];
 if (typeof pos != "integer")
 {
  if (typeof pos == "float" || typeof pos == "string") pos = pos.tointeger();
  else return "";
 }
 if (pos >= tok.len()) return "";
 else if (pos < 0) pos = 0;
 if (len == null)
  len = (tok.len() - pos);
 else if (typeof len != "integer")
 {
  if (typeof len == "float" || typeof len == "string") len = len.tointeger();
  else return "";
 }
 if ((pos+len) > tok.len()) len = (tok.len() - pos);
 else if (len <= 0) return "";
 tok = tok.slice(pos, pos+len);
 if (tok.len() > 1)
 {
  local res = tok[0];
  tok.remove(0);
  foreach (tk in tok) res += sep + tk;
  return res;
 }
 else if (tok.len() == 1) return tok[0];
 else return "";
}

function NumTok(str, sep)
{
 if (typeof str != "string" || str.len() < 1) return 0;
 else if (typeof sep != "string" || sep.len() < 1) return 0;
 local tok = split(str, sep);
 if (typeof tok != "array") return 0;
 else if (tok.len() == 1 && tok[0] == str) return 0;
 else return tok.len();
}

Commands:
function onPlayerCommand( player, cmd, text )
{
    local plr, i = 0;
if ( text ) {
plr = FindPlayer( text );
i = NumTok(text, " ").tointeger();
}

    if ( cmd == "team" )
    {
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( pinfo[ player.ID ].Team == true ) PrivMessage( player, "[Error] You already have a team." );
else if ( !text ) PrivMessage( player, "Syntax: /team <player name or id>" );
else if ( !plr ) PrivMessage( player, "[Error] Unknown player." );
else if ( pinfo[ plr.ID ].Team == true ) PrivMessage( player, "[Error] " + plr.Name + " is already in a team." );
else if ( pinfo[ player.ID ].Request == true ) PrivMessage( player, "[Error] You already have a request." );
else if ( pinfo[ plr.ID ].Request == true ) PrivMessage( player, "[Error] " + plr.Name + " already have a request." );
else
{
if ( pinfo[ player.ID ].TimeRequest < time() ) {
pinfo[ player.ID ].Request = false; pinfo[ player.ID ].Partner = null;  pinfo[ player.ID ].TimeRequest = 0;
pinfo[ plr.ID ].Request = false; pinfo[ plr.ID ].Partner = null; pinfo[ plr.ID ].TimeRequest = 0;
}
   
PrivMessage( plr, "[!] " + player.Name + " would like to team up with you." );
PrivMessage( player, "Request submitted." );
pinfo[ player.ID ].Partner = plr;
pinfo[ plr.ID ].Partner = player;
pinfo[ player.ID ].TimeRequest = time() + 30;
pinfo[ plr.ID ].TimeRequest = time() + 30;
pinfo[ plr.ID ].Request = true;
pinfo[ player.ID ].Request = true;
}
}
 
else if ( cmd == "accept" )
{
local plr = FindPlayer( pinfo[ player.ID ].Partner );
if ( pinfo[ player.ID ].Request == false ) PrivMessage( player, "[Error] You don't have a request." );
else if ( pinfo[ player.ID ].Team == true ) PrivMessage( player, "[Error] You already have a team-mate." );
else
{
if ( pinfo[ player.ID ].TimeRequest < time() ) {
PrivMessage( player, "[Error] Time ended." );
pinfo[ player.ID ].Request = false;
pinfo[ player.ID ].Partner = null;
pinfo[ plr.ID ].Request = false;
pinfo[ plr.ID ].Partner = null;
pinfo[ player.ID ].TimeRequest = 0;
pinfo[ plr.ID ].TimeRequest = 0;
    } else {
   
PrivMessage( plr, "[!] " + player.Name + " is doing team with you." );
PrivMessage( player, "Request Accepted! You are now teaming with " + plr.Name );
pinfo[ player.ID ].Team = true;
pinfo[ plr.ID ].Team = true;
pinfo[ player.ID ].Request = false;
pinfo[ plr.ID ].Request = false;
pinfo[ player.ID ].TimeRequest = 0;
pinfo[ plr.ID ].TimeRequest = 0;
player.Pos = plr.Pos;
}
}
}
   
else if ( cmd == "deny" )
{
if ( pinfo[ player.ID ].Request == false ) PrivMessage( player, "[Error] You don't have a request." );
else
{
                   local plr = FindPlayer( pinfo[ player.ID ].Partner );
   if ( pinfo[ player.ID ].TimeRequest < time() ) {
PrivMessage( player, "[Error] Time ended." );
pinfo[ player.ID ].Request = false;
pinfo[ plr.ID ].Request = false;
pinfo[ player.ID ].Partner = null;
pinfo[ plr.ID ].Partner = null;
pinfo[ player.ID ].TimeRequest = 0;
pinfo[ plr.ID ].TimeRequest = 0;
   } else {
   
   PrivMessage( plr, "[!] " + plr.Name + " denied your request." );
   PrivMessage( player, "Request Denied." );
   pinfo[ player.ID ].Request = false;
   pinfo[ plr.ID ].Request = false;
   pinfo[ player.ID ].TimeRequest = 0;
   pinfo[ plr.ID ].TimeRequest = 0;
   }
}
}

else if ( cmd == "leave" )
{
if ( pinfo[ player.ID ].Team == false ) PrivMessage( player, "[Error] You don't have team." );
else
{
                        local plr = FindPlayer( pinfo[ player.ID ].Partner );
                        PrivMessage( plr, "[!] " + player.Name + " left the team." );
PrivMessage( player, "You are not more team of " + plr.Name );
pinfo[ player.ID ].Team = false;
pinfo[ plr.ID ].Team = false;
pinfo[ player.ID ].Partner = null;
pinfo[ plr.ID ].Partner = null;
}
}
}

Credits
Scripter: Fjose
Special thanks to:
S.L.C. - For his special functions (GetTok & NumTok)
Honey & soulshaker - For supporting me with the current problems about some functions.
#88
I know but IPtoCountry take much memory.
#89
Hellow guys,
I want to know if there is a possible module for replace the geo_ip? if the answer is no, what program or programs I need to compile a module for this?

How I can use that? of multiple instances.
#90
Clans and Families / [LBR] - Legion Brazilian
Oct 17, 2014, 02:01 AM


Official Forum: http://lbr.xs-evolution.com
Clan Tags: (LBR) (LBR_R) (LBR_T)
Leaders: (LBR)George & (LBR)Junior
Co-Leaders: (LBR)MatheuS
IRC Channel: #LBR on LUNet

Founded on his beginnings for only brazilians on 14th July 2009 by George. LBR was increasing and  becoming in an international clan where everybody is free to apply. We want loyal members, friendly with a little experience on this game to kick some asses. We're accepting people with a domain to understand/speak english/spanish/portuguese. George and Junior are the current clan administrators for any doubts. LBR is divided in three groups or tags [LBR] [LBR_R] [LBR_T].


George [Founder]
Junior [Leader]
Matheus [Co-Leader]
Diogo
Anta171
Rockz
Replicante
Lucas
UisterX
Leandro/Lance
Andre Fernandes
Robson_BR
Franklin
Diego
Jilson


Enderson
Sami
Victor_br



AFF^ 
Henning
Joseph Smith
MauricioBR
Delator
HeadsMan
Guilherme/guiisaoVL 
Luiyi
Balys
Vitor Ferreira / Trevor
Blackmaster
Samuel
CucaLonga


******************************
Clan Statistics
******************************

Total Full Members: 15
Total Rookie Members: 3
Total Trainee Members: 13
Total Members: 31

Active Members: 15
Inactive Members (red color): 16

******************************
Servers written by us
******************************


Xtreem Server Evolution

[spoiler=Wordpad's version]Xs Evolution

Forum: http://xs-evolution.com
Name: Xs -> Evolution R2
IP: server.xs-evolution.com:5192
Server Status: Active
Developers: (LBR)George & (LBR)Junior
Scripters: [LBR]Franklin & (LBR)Lucas
Script Version: MVS 2.0
Gamemode: TDM&GW
Irc Channel: #xs-evolution on irc.liberty-unleashed.co.uk
[/spoiler]