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.


Messages - [Tkiller]

Pages: [1]
1
mIRC/pawn Scripting / Re: help
« on: March 15, 2012, 08:47:21 am »
LOl...
U dont read my script and give your silly comment.....
This is Filter Script just copy paste all Data in new Pawn file compile it and Run it....
I dont waste my time by uploading file understand......

2
mIRC/pawn Scripting / Re: help
« on: March 15, 2012, 08:39:05 am »
[pawn]#include <a_vcmp>

#define FILTERSCRIPT

#if defined FILTERSCRIPT
#define COLOR_GREY 0xBEBEBEAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_YELLOW 0xFFFF00AA

forward ShowStats(playerid,targetid);
forward OnPlayerUpdate(playerid);
forward Encrypt(string[]);
forward OnPlayerLogin(playerid,const string[]);

enum pInfo
{
   pPassword[128],
   pKills,
   pDeaths,
   pCash,
   pScore,
};

new PlayerInfo[MAX_PLAYERS][pInfo];
new gPlayerLogged[MAX_PLAYERS];
new gPlayerAccount[MAX_PLAYERS];


public OnFilterScriptInit()
{
   print("Register System Loaded\n");
   return 1;
}

public OnFilterScriptExit()
{
   return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
   return 1;
}

public OnPlayerRequestSpawn(playerid)
{
   return 1;
}

public OnPlayerConnect(playerid)
{
    new playrname[MAX_PLAYER_NAME];
      new connect[128];
    GetPlayerName(playerid, playrname, sizeof(playrname));
   format(connect, sizeof(connect), "%s.cer", playrname);
      if(gPlayerAccount[playerid] == 1) {
      GameTextForPlayer(playerid,"~o~Please Login ! Type: /c login [password] !");
      TogglePlayerControllable(playerid,1);
      }
      if(gPlayerAccount[playerid] == 0) {
      GameTextForPlayer(playerid,"~o~Please Login ! Type: /c login [password] !");
      TogglePlayerControllable(playerid,1);
      }
   return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    OnPlayerUpdate(playerid);
    gPlayerLogged[playerid] = 0;
   return 1;
}

public OnPlayerSpawn(playerid)
{
   return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new kills = PlayerInfo[playerid][pKills];
    SetPlayerScore(playerid, kills);
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    if(Health == 0.0)
    {
    PlayerInfo[playerid][pDeaths] += 1;
    }
    PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 1;
   return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
      new tmp[256];
    new playername[MAX_PLAYER_NAME];
    if (strcmp(cmd, "login", true) ==0 )
   {
       if(IsPlayerConnected(playerid))
       {
           new tmppass[64];
         if(gPlayerLogged[playerid] == 1)
         {
            SendClientMessage(playerid, COLOR_GREY, "   You are Logged.");
            return 1;
         }
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GREY, "   USAGE: /login [password]");
            return 1;
         }
         strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
         Encrypt(tmppass);
         OnPlayerLogin(playerid,tmppass);
         TogglePlayerControllable(playerid,1);
      }
      return 1;
   }
   if (strcmp(cmd, "register", true)==0)
   {
      new string[265];
      tmp = strtok(cmdtext, idx);
      if(!strlen(tmp))
      {
         SendClientMessage(playerid, COLOR_GREY, "USAGE: /c register [password]");
         return 1;
      }
      if (gPlayerAccount[playerid] == 1)
      {
         SendClientMessage(playerid, COLOR_GREY, "   This name is already registered!");
         return 1;
      }

      strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255);
      Encrypt(PlayerInfo[playerid][pPassword]);
      GetPlayerName(playerid, playername, sizeof(playername));
      format(string, sizeof(string), "%s.cer", playername);
      new File: file = fopen(string, io_read);
      if (file)
      {
         SendClientMessage(playerid, COLOR_GREY, "   This name is already registered!");
         fclose(file);
         return 1;
      }
      new File:hFile;
      hFile = fopen(string, io_append);
      new var[32];//
        format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
        format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
        format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
        PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
        PlayerInfo[playerid][pScore] = GetPlayerScore(playerid);
        format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
        format(var, 32, "Score=%d\n",PlayerInfo[playerid][pScore]);fwrite(hFile, var);
      fclose(hFile);
      SendClientMessage(playerid, COLOR_WHITE, "You are now registered!");
      SendClientMessage(playerid, COLOR_WHITE, "Write /c login [password] to login!");
      OnPlayerLogin(playerid,PlayerInfo[playerid][pPassword]);
      TogglePlayerControllable(playerid,1);
      return 1;
   }
   if (strcmp(cmd, "stats", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         if (gPlayerLogged[playerid] != 0)
         {
            ShowStats(playerid,playerid);
         }
         else
         {
            SendClientMessage(playerid, COLOR_GRAD1, "  You not are Logged !");
         }
      }
      return 1;
   }
   return 0;
}

public Encrypt(string[])
{
   for(new x=0; x < strlen(string); x++)
     {
        string
  • += (3^x) * (x % 15);

        if(string
  • > (0xff))

        {
           string
  • -= 64;

        }
     }
   return 1;
}


public OnPlayerLogin(playerid,const string[])
{
    new pname2[MAX_PLAYER_NAME];
   new pname3[MAX_PLAYER_NAME];
   new string2[64];
   new string3[128];
   GetPlayerName(playerid, pname2, sizeof(pname2));
   format(string2, sizeof(string2), "%s.cer", pname2);
   new File: UserFile = fopen(string2, io_read);

   if (UserFile)
   {
      new valtmp[128];
      fread(UserFile, valtmp);strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);

      if ((strcmp(PlayerInfo[playerid][pPassword], string, true, strlen(valtmp)-1) == 0))
      {
         new key[128],val[128];
          new Data[128];
          while(fread(UserFile,Data,sizeof(Data)))
         {
            key = ini_GetKey(Data);
                if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
                if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
                if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
            if( strcmp( key , "Score" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pScore] = strval( val ); }
                SetPlayerMoney(playerid,PlayerInfo[playerid][pCash]);
                SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
         }
         fclose(UserFile);
         gPlayerLogged[playerid] = 1;
         gPlayerAccount[playerid] = 1;
          new kills = PlayerInfo[playerid][pKills];
            SetPlayerScore(playerid, kills);
         GetPlayerName(playerid, pname3, sizeof(pname3));
         format(string3, sizeof(string3), "Welcome %s !", pname3);
         SendClientMessage(playerid, COLOR_WHITE,string3);
      }
      else
      {
         SendClientMessage(playerid, COLOR_GREY, "   Login Failed !");
         fclose(UserFile);
      }
   }
   return 1;
}

public OnPlayerUpdate(playerid)
{
   if(IsPlayerConnected(playerid))
   {
      if(gPlayerLogged[playerid])
      {
         new string3[32];
         new pname3[MAX_PLAYER_NAME];
         GetPlayerName(playerid, pname3, sizeof(pname3));
         format(string3, sizeof(string3), "%s.cer", pname3);
         new File: pFile = fopen(string3, io_write);
         if (pFile)
         {
            new var[32];
            format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var);
            fclose(pFile);
            new File: hFile = fopen(string3, io_append);
            PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
            format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
            format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
            format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
            format(var, 32, "Score=%d\n",PlayerInfo[playerid][pScore]);fwrite(hFile, var);
            fclose(hFile);
         }
      }
   }
   return 1;
}

stock ini_GetKey( line[] )
{
   new keyRes[128];
   keyRes[0] = 0;
    if ( strfind( line , "=" , true ) == -1 ) return keyRes;
    strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
    return keyRes;
}

stock ini_GetValue( line[] )
{
   new valRes[128];
   valRes[0]=0;
   if ( strfind( line , "=" , true ) == -1 ) return valRes;
   strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
   return valRes;
}


strtok(const string[], &index)
{
   new length = strlen(string);
   while ((index < length) && (string[index] <= ' '))
   {
      index++;
   }

   new offset = index;
   new result[20];
   while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
   {
      result[index - offset] = string[index];
      index++;
   }
   result[index - offset] = EOS;
   return result;
}

public ShowStats(playerid,targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
   {
       new score = GetPlayerScore(targetid);
      new cash =  GetPlayerMoney(targetid);
      new deaths = PlayerInfo[targetid][pDeaths];
      new kills = PlayerInfo[targetid][pKills];
      new name[MAX_PLAYER_NAME];
      GetPlayerName(targetid, name, sizeof(name));
      new Float:px,Float:py,Float:pz;
      GetPlayerPos(targetid, px, py, pz);
      new coordsstring[256];
      format(coordsstring, sizeof(coordsstring), "Name: %s => Kills: %d Deaths: %d Cash: $%d Score: %d",name,kills,deaths,cash,score);
      SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
   }
}

#endif[/pawn]



Use your mind to copy paste this in your scripts......

3
mIRC/pawn Scripting / How to add loc on player death.....
« on: March 13, 2012, 04:54:22 pm »
iam trying to add loc but iam failed so i post it....
please help me

[pawn]      MessagePMFormat(killerid, GREEN,"Killed: %s, Wep: %s, Part: %s, Distance: %d, Reward:$ %d, Loc: %s",gPlayers[playerid],GetWeaponNameID(reason),GetBodyPartName(bodypart),GetDistance(playerid,killerid),reward,GetPlayerLocation( playerid ));[/pawn]

on playerlocation i put that but something happened wrong it gives me Bodypart loc why....
[pawn]public GetPlayerLocation( playerid )
{
   new a=0, b=1, c=0;
      new szMsg[ 256 ];
      format( szMsg, sizeof( szMsg ), "Vice-City" );
   new Float:x, Float:y, Float:z;
   GetPlayerPos(playerid, x, y, z);
   return 1;
}[/pawn]

4
mIRC/pawn Scripting / Re: How to add timer In Commands Of FBS...?
« on: February 28, 2012, 10:54:49 am »
Ok....

5
mIRC/pawn Scripting / Anti-spawn kill Sux...
« on: February 28, 2012, 10:54:13 am »
I make anti spawn kill but iam failed,that's why i post it here so one can help me...

[pawn]SetTimer("AntiSpawnkill",5000,0);[/pawn]



public onplayerspawn i put this
[pawn]   }
   else SetPlayerMoney( playerid, 0 );
    SetPlayerHealth(playerid, 9999);
    SendClientMessage(playerid, RED, "[INFO]:You have 5 seconds of Anti-Spawnkill protection");
    SetTimer("AntiSpawnkill",5000,0);
       return 1;
}[/pawn]

in function i put that to reset player health to 100 after time over
[pawn]public AntiSpawnkill(playerid)
{
    SetPlayerHealth(playerid, 100.0);
    SendClientMessage(playerid, RED, "[INFO]:Anti-Spawnkill protection over, you are on your own now");
    return 1;
}[/pawn]



So please check it,or i want that on spawn kill the player is drowned so what i do....

Help...

7
mIRC/pawn Scripting / Re: How to set time to end an event....
« on: February 28, 2012, 09:15:46 am »
Quote
    I do believe that SetFriendlyFire can be used JUST in OnGameModeInit (IIRC).


So badly people cannot read the bold letters

Oh,Sorry,I can't focus my mind..... :-[

8
mIRC/pawn Scripting / Re: How to set time to end an event....
« on: February 28, 2012, 08:48:07 am »
Lol....
I know it's set in Gmaemodeinit,but i want to set it for My event man,you don't get it(o_0)

9
mIRC/pawn Scripting / How to add timer In Commands Of FBS...?
« on: February 28, 2012, 08:03:08 am »
Hey friends,
Iam totally new in Squirrel scripting i dont know any thing i just download FBS,and trying to modify it,
But the problem is that,
Is there any compiler for Squirrel scripting like pawn scripting has Pawno,Or it's(squirrel) scripted on notepad.

Or how to set timer in !goto,!gotoloc and heal command...
Please help iam totally new one on this.....

10
mIRC/pawn Scripting / Re: How to set time to end an event....
« on: February 28, 2012, 07:59:44 am »
Quote
You use waaaayyy to much timers, amd about the friendly fire thing, I don't think it works.


Ohh and a note: We cannot pass playerid from function to timer

This is totally wrong as it will refer to 0

Quote

    for(new i = 0; i <= MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i)) SetPlayerPos(i,-1723.20898,-156.52439,14.86832,0,0);
    SetPlayerFriendlyFire(1);
    TogglePlayerControllable(i, 0);
    SetPlayerWeapon(i, 21, 999);
    SetPlayerWeapon(i, 23, 999);
    SetPlayerWeapon(i, 26, 999);
    SendClientMessageToAll(RED,"Event Started Kill every one to Be a winner");
    SetTimer( "CountRace1", 1000, 0 );
    SetTimer( "CountRace2", 2000, 0 );
    SetTimer( "CountRace3", 3000, 0 );
    SetTimer( "FinalCountRace", 4000, 0 );


This is the correct version

SOO... Conclusion:

You use too much timers which lag the server, I will use just one...


But the idea is original and good



Thanks,
But still the fucking Friendly fire problem.....

11
mIRC/pawn Scripting / How to set time to end an event....
« on: February 27, 2012, 07:46:10 am »
I make an auto event Royal rumble,But the problem is that i want when event started the friendly fire set to be 0(same skin players kill same skin players) for only 5 minutes,after that friendly fire set to be 1(same skin player cannot be able to kill same skin players)...


On gamemodeinit i put this,
[pawn]SetTimer("RoyalRumble",200000,1);[/pawn]


In function i put that,
[pawn]public RoyalRumble()
{
new playerid;
for(new i = 0; i <= MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) SetPlayerPos(i,-1723.20898,-156.52439,14.86832,0,0);
SetPlayerFriendlyFire(1);
TogglePlayerControllable(playerid, 0);
SetPlayerWeapon(i, 21, 999);
SetPlayerWeapon(i, 23, 999);
SetPlayerWeapon(i, 26, 999);
SendClientMessageToAll(RED,"Event Started Kill every one to Be a winner");
SetTimer( "CountRace1", 1000, 0 );
SetTimer( "CountRace2", 2000, 0 );
SetTimer( "CountRace3", 3000, 0 );
SetTimer( "FinalCountRace", 4000, 0 );
}
return 1;
}[/pawn]


And in final count i put that For Toggle player controllable

[pawn]public FinalCountRace()
{
new plr;
   GameTextForAll("==~o~Go ~p~Go! ~x~Go==" );
   TogglePlayerControllable(plr, 1);
}[/pawn]


Please Help me....

12
mIRC/pawn Scripting / Re: little problem ++++Click++++
« on: February 27, 2012, 07:40:50 am »
Thanks so much.... :D

13
mIRC/pawn Scripting / Re: Help for Timing In Announce Message
« on: February 26, 2012, 11:11:21 am »
what do you mean by announce...
There is only news system.....

14
mIRC/pawn Scripting / little problem ++++Click++++
« on: February 26, 2012, 07:58:42 am »
[pawn]   else if (strcmp(cmd, "!race", true) == 0)
   {
   tmp = strtok(cmdtext, idx);
      if (!strlen(tmp)) {
      SetPlayerPos(playerid,-1051.5901,321.7699,10.7553);
        ResetPlayerWeapons(playerid);
        PutPlayerInVehicle(playerid,100);
        PutPlayerInVehicle(playerid,101);
        PutPlayerInVehicle(playerid,102);
        PutPlayerInVehicle(playerid,103);
        SendClientMessageToAll(GREEN, "Wait 10 seconds for more players");
      format( szMsg, 128, "%s is now on racetrack, type !race for race with him",gPlayers[playerid]);
       SendClientMessageToAll( RED, szMsg );
       GameTextForAllBottom("~g~End ~g~On ~g~Malibu!");
      }
      return 1;
   }[/pawn]




I make a race command like this...
when player type race the automatically put in vehicle,but the problem is that players only put in first vehicles not others vehicles....
so what can id o for this...
and when they finish race,then other player type race so they wont go on racetrack they directly put in vehicle of where the race ends,not on racetrack....

15
mIRC/pawn Scripting / Event to create...?
« on: February 23, 2012, 07:02:23 am »
iam busy in making a event "race"...
But to hard work iam still fail..
so i think that i post my problem on forum...so one can help me...

I want to create a command !race in which player go to airport..and the event started but the problem is that i want the automatic count down of 20 seconds...after these the race started and who win the race the name appear on screen and automatically server give him cash...
So,please help me over...

Pages: [1]