Author Topic: Some Help That Got Crashed In The Database  (Read 5072 times)

0 Members and 1 Guest are viewing this topic.

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Some Help That Got Crashed In The Database
« on: July 17, 2012, 05:31:35 am »
I need some help. I have two questions (Got deleted during the database crash) How would I make it so when someone spawns as a certain skin it gives it special abbilities. For instance, if I were to be a cop how would I make it on the spawn to tell the server that the player is a cop and is alloud to use cop functions.

And then another thing is, how do you use an include? I downloaded this include about /c ban and /c subnet ban and I installed it and nothing happens. I put the include in the folder, I added the Bans/Subnets in my scriptfiles like it told me to, and I added it at the top of my GM. But nothing happens. How would I get the include to work? It's a good thing I save my downloads. This was on the forum but it got deleted along with the rest of the script release but the link to it is here: http://www.mediafire.com/?y1ewh4bgl3bwurv How would I do this?

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Some Help That Got Crashed In The Database
« Reply #1 on: July 17, 2012, 12:48:45 pm »
Woah, been some time since I did not wrote a pawn script ;d

1:

[pawn]new IsCop[MAX_PLAYERS];[/pawn]


then call at on player spawn that if the player is classid x he is supposed to be cop

[pawn]IsCop[playerid]=1;[/pawn]


2: [pawn]#include <name>[/pawn]
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Re: Some Help That Got Crashed In The Database
« Reply #2 on: July 20, 2012, 09:20:54 am »
Thanks but I'm not sure if I understand #1. IsCop how would it know its a cop? All it is your telling me that a skin is that cop. IsCop[playerid]=1; Is the 1 the cop id or is it telling the script you are the cop.
If that how would I tell it it's a cop?

#2 is what I'm saying
Quote
I put the include in the folder, I added the Bans/Subnets in my scriptfiles like it told me to, and I added it at the top of my GM. But nothing happens.
But no commands or functions work.
« Last Edit: July 20, 2012, 09:24:21 am by kitt85711 »

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: Some Help That Got Crashed In The Database
« Reply #3 on: July 20, 2012, 04:11:48 pm »
well based on shadow´s explain..... you will know if the player is a cop by the class.

EXAMPLE:!!

if(classid = 1)
{
IsCop[playerid] = 1;
}
if(classid = 2)
{
IsTaxi[playerid] = 1;
}

and.....................

Then on player death.

IsCop[playerid] = 0;
IsTaxi[playerid] = 0;

got it?

:D
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline LisKa

  • Street Thug
  • *
  • Posts: 8
  • Pawn, Squirrel Scripter [Owner of Vice-Role Play]
    • View Profile
    • Vice-Role Play Server
Re: Some Help That Got Crashed In The Database
« Reply #4 on: July 20, 2012, 04:56:59 pm »
See, Put it first:

[pawn]new IsCop[MAX_PLAYERS];[/pawn]


Now in the OnPlayerSpawn event:

[pawn]public OnPlayerSpawn(playerid,classid)
{
        new IsCop[MAX_PLAYERS];
        IsCop[playerid]=1;
        new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];
        new string[256];
   GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
        format(string,sizeof(string),"%s has spawned as cop.",gPlayers[playerid]);
        SendClientMessageToAll(COLOR_YELLOW,);
   return 1;
}[/pawn]

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Re: Some Help That Got Crashed In The Database
« Reply #5 on: July 21, 2012, 04:23:21 am »
Thanks Dilson and Liska  :D Now I want to know why the include of the ban and sub ban wont work even if I add it on the top of my gamemode.

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: Some Help That Got Crashed In The Database
« Reply #6 on: July 21, 2012, 04:56:52 am »
Your welcome man :D.

Well show us your Include code, for me to explain how to use it :D
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Re: Some Help That Got Crashed In The Database
« Reply #7 on: July 21, 2012, 05:58:45 am »
Its more than one include. Its Aban and then two others that want me to replace Dini and Dutlis
 Aban one

Quote
/*
 *            Aban 1.0
 *       (c) Copyright 2011 by Aldo
 *
 * @author    : Aldo (www.aldo-aldo.com), ([email protected])
 * @date      : 13th May 2011
 * @update    : 13th May 2011
 * @require   : Dini 1.5.1 by DracoBlue (http://dracoblue.com)
 *
 * This include is provided as is (no warranties).
 *
 */
 
 #if defined _aban_included
  #endinput
#endif

#define _aban_included
#pragma library dini

#include <dini>
#define BANFILE    "/Bans/%s.ini"
#define SBANFILE    "/Bans/Subnets/%s.ini"

//====================================================================================================
stock BanIP(IP[], Admin[], Player[], Reason[])
{
   new ban[30];
    format(ban, sizeof(ban), BANFILE, IP);
    dini_Create(ban);
   dini_Set(ban, "Username", Player);
   dini_Set(ban, "IP", IP);
   dini_Set(ban, "Banned-By", Admin);
   dini_Set(ban, "Reason", Reason);
   return true;
}

stock Unbanip(IP[])
{
   new ban[30];
   format(ban, sizeof(ban), BANFILE, IP);
   if(!dini_Exists(ban))
   {
      return false;
   }
   else
   {
      dini_Remove(ban);
      return true;
   }
}

stock BanCheckIP(player)
{
   new IP[16], ban[30];
    GetPlayerIp(player,IP,16);
    format(ban, sizeof(ban), BANFILE, IP);
    if(dini_Exists(ban))
   {
        new name[MAX_PLAYER_NAME], string[50];
        GetPlayerName(player,name,MAX_PLAYER_NAME);
        format(string, sizeof(string), "[AUTO KICK] %s was kicked for Banned IP",name);
        SendClientMessageToAll(0xF6A113FF, string);
        Kick(player);
      return true;
    }
   else
   {
      return false;
   }
}

stock Unbanname(name[])
{
   new ban[30];
   format(ban, sizeof(ban), BANFILE, name);
   if(!dini_Exists(ban))
   {
      return false;
   }
   else
   {
      dini_Remove(ban);
      return true;
   }
}

stock BanName(IP[], Admin[], Player[], Reason[])
{
   new ban[30];
    format(ban, sizeof(ban), BANFILE, Player);
    dini_Create(ban);
   dini_Set(ban, "Username", Player);
   dini_Set(ban, "IP", IP);
   dini_Set(ban, "Banned-By", Admin);
   dini_Set(ban, "Reason", Reason);
   return true;
}

stock BanCheckName(player)
{
   new ban[30];
   new name[MAX_PLAYER_NAME];
    GetPlayerName(player,name,MAX_PLAYER_NAME);
    format(ban, sizeof(ban), BANFILE, name);
    if(dini_Exists(ban))
   {
        new string[60];
        format(string, sizeof(string), "[AUTO KICK] %s was kicked for Banned Nick",name);
        SendClientMessageToAll(0xF6A113FF, string);
        Kick(player);
      return true;
   }
   else
   {
      return false;
   }
}

//====================================================================================================
stock GetSubnet(IP[])
{//This function is made by aXXo :)
   new IP1[76],IP2[76],counter=0;
   IP1=strtok(IP,counter,'.');
   IP2=strtok(IP,counter,'.');
   new Subnet[72];
   format(Subnet,sizeof(Subnet),"%s.%s",IP1,IP2);
   return Subnet;
}

stock Subnetunban(IP[])
{
   new sban[30];
   format(sban, sizeof(sban), SBANFILE, GetSubnet(IP));
   if(!dini_Exists(sban))
   {
      return false;
   }
   else
   {
      dini_Remove(sban);
      return true;
   }
}

stock SubnetbanCheck(player)
{
   new IP[16],sban[30];
   GetPlayerIp(player,IP,16);
   format(sban, sizeof(sban), SBANFILE, GetSubnet(IP));
   if(dini_Exists(sban))
   {
       new name[MAX_PLAYER_NAME], string[50];
        GetPlayerName(player,name,MAX_PLAYER_NAME);
        format(string, sizeof(string), "[AUTO KICK] %s was kicked for Banned Subnet",name);
        SendClientMessageToAll(0xF6A113FF, string);
        Kick(player);
      return true;
   }
   else
   {
      return false;
   }
}

stock Subnetban(IP[], Admin[], Player[], Reason[])
{
   new sban[30];
    format(sban, sizeof(sban), SBANFILE, GetSubnet(IP));
    dini_Create(sban);
   dini_Set(sban, "Username", Player);
   dini_Set(sban, "IP", IP);
   dini_Set(sban, "Banned-By", Admin);
   dini_Set(sban, "Reason", Reason);
   return true;
}

//====================================================================================================



Offline cocky

  • Street Thug
  • *
  • Posts: 24
    • View Profile
Re: Some Help That Got Crashed In The Database
« Reply #8 on: July 21, 2012, 04:07:38 pm »
Actually ABan only offers the functions required to make a ban system So, you need to make your own command with these functions.

Code: [Select]

 BanIP(IP[], Admin[], Player[], Reason[])
 Unbanip(IP[])
 BanCheckIP(player)
 Unbanname(name[])
 BanName(IP[], Admin[], Player[], Reason[])
 BanCheckName(player)
 GetSubnet(IP[])
 Subnetunban(IP[])
 SubnetbanCheck(player)
 Subnetban(IP[], Admin[], Player[], Reason[])

If you don't know how to do it then try editing ban command from one of the released script.

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Re: Some Help That Got Crashed In The Database
« Reply #9 on: July 21, 2012, 05:35:04 pm »
Ah ok, thank you

Offline Thomas.MK

  • Street Thug
  • *
  • Posts: 3
    • View Profile
Re: Some Help That Got Crashed In The Database
« Reply #10 on: July 25, 2012, 10:50:52 am »
See, Put it first:

[pawn]new IsCop[MAX_PLAYERS];[/pawn]


Now in the OnPlayerSpawn event:

[pawn]public OnPlayerSpawn(playerid,classid)
{
        new IsCop[MAX_PLAYERS];
        IsCop[playerid]=1;
        new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];
        new string[256];
   GetPlayerName(playerid,gPlayers[playerid],MAX_PLAYER_NAME);
        format(string,sizeof(string),"%s has spawned as cop.",gPlayers[playerid]);
        SendClientMessageToAll(COLOR_YELLOW,);
   return 1;
}[/pawn]
look what the?


[pawn]public OnPlayerSpawn(playerid,classid)
{
        new IsCop[MAX_PLAYERS];[/pawn]

you need to create it as a globle variable not as event local variable....


-.-

put it where other constants are.usually top of script
Taz!!!!!!!!!!!!!!er