Vice City Multiplayer
		VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: kitt85711 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?
			 
			
			- 
				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]
			 
			
			- 
				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 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.
			 
			
			- 
				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
			 
			
			- 
				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]
			 
			
			- 
				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.
			
 
			
			- 
				Your welcome man :D.
Well show us your Include code, for me to explain how to use it :D
			 
			
			- 
				Its more than one include. Its Aban and then two others that want me to replace Dini and Dutlis
 Aban one
/*
 *            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;
}
//====================================================================================================
			 
			
			- 
				Actually ABan only offers the functions required to make a ban system So, you need to make your own command with these functions.
 
 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.
			 
			
			- 
				Ah ok, thank you
			
 
			
			- 
				
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