Recent Posts

Pages: 1 2 [3] 4 5
21
Scripting Help / Player Registers View System by katana
« Last post by (R2x)spider on February 03, 2013, 05:46:16 pm »
Hello, I bring a serving command visits to see yourself or another player.

First, add this line:

Pawno Code: [Select]
new file[128];

But, if you already have it, you do not add...

Now let "OnPlayerDisconnect" , and add this :

Pawno Code: [Select]
OneMoreVisit(playerid,1);

Now let "OnPlayerText" , and add this :

Pawno Code: [Select]
else if ( strcmp( cmd, "!views", true ) == 0 )
   {
      tmp = strtok( cmdtext, idx );
      if ( !IsPlayerRegistered(gPlayers[ playerid ]) )
            {
               format( szMsg, sizeof( szMsg ), "Error: You need to be registered!");
               SendClientMessage( playerid, COLOR_GREEN, szMsg );
            }
      if ( !strlen( tmp ) )
      {
         new vis;vis = PlayerViews( playerid );
         format( szMsg, sizeof( szMsg ), "Your views (%s) : [%d]", gPlayers[ playerid ], vis );
         SendClientMessage(playerid, GREEN, szMsg );
      }
      else
      {
         newvar = FindPlayerIDFromString( tmp );
         if ( !IsPlayerRegistered(gPlayers[ newvar ]) )
            {
               format( szMsg, sizeof( szMsg ), "Error: %s is not registered!", gPlayers[ newvar ] );
               SendClientMessage( playerid, COLOR_GREEN, szMsg );
            }
   if ( newvar == INACTIVE_PLAYER_ID )
         {
     new vis; vis = PlayerViews( newvar );
            format( szMsg, sizeof( szMsg ), "Visits (%s) : [%d]", gPlayers[ newvar ], vis );
            SendClientMessageToAll( GREEN, szMsg );
         }
         else SendClientMessage( playerid, COLOR_RED, "Error: Unknown player." );
      }
      return 1;
      }

Now add the publics:

Pawno Code: [Select]
public PlayerViews(playerid)
{
format(file,128, USERS_FILE, gPlayers[playerid]);
   new vi = dini_Int(file,"Visits");
   return vi;
}
//-----------------------------------------------------------------------------//
public OneMoreVisit(playerid,amount)
{
    format(file,128, USERS_FILE, gPlayers[playerid]);
   dini_IntSet(file,"Visits", PlayerViews(playerid)+amount);
}
//----------------------------------------------------------------------------//
stock IsPlayerRegistered( player[] )// [ - is replace for : [
{ // We need to give the full nick name.
   format( file, sizeof( file ), USERS_FILE, player);
   return ( dini_Exists( file ) ) ? true : false;
}
22
Scripting Help / anti-clan and anti-insult system for noobs
« Last post by (R2x)spider on February 03, 2013, 05:44:46 pm »
hi all
i think even some advanced scripters wont know that, but, i will show you some of the 2 systems ive made
the anti insult works like that: if like anyone types a abusing word example "monfuck" it detects the "****" and kicks them 100% tested even if they type "you fucker" it detects "****" and kicks them. Here is the code

This is the anti insult system

Put this under onplayertext

Pawno Code: [Select]
public OnPlayerText(playerid, cmdtext[])//you may have OnPlayerText(playerid) change it to OnPlayerText(playerid, cmdtext)
CheckInsult(playerid, cmdtext);

Make a public CheckInsult(playerid, c[])
Pawno Code: [Select]
   new cde[256]; cde = "CountRegisters";
   if (strfind(c, "****", true) != -1 || strfind(c, "*****", true) != -1 ) Kicks(playerid, "Insulting Admins/Players");
   if (strfind(c, "******", true) != -1 || strfind(c, "bullshit", true) != -1 ) Kicks(playerid, "Insulting Admins/Players");
   if (strfind(c, "ass", true) != -1 || strfind(c, "stupid", true) != -1 ) Kicks(playerid, "Insulting Admins/Players");
   if (strfind(c, "gay", true) != -1 || strfind(c, "sexy", true) != -1 ) Kicks(playerid, "Insulting Admins/Players");
    return 0;

this is the anti-clancheat system

Put this under public OnPlayerCommandText(playerid, cmdtext)
Pawno Code: [Select]
public OnPlayerCommandText(playerid, cmdtext)
      if (strcmp(cmd, "clan", true) == 0) {
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      if (IsLevel(playerid,6)) return 0;//Change IsLevel(playerid,6) to what you use to check if player is a admin
      else if (!strlen(tmp)) SendClientMessage(playerid, GREEN,"ERROR: Invalid Syntax - Use  /c %s <playerid/name>.",cmdtext);
      else {
           if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid, GREEN,"ERROR: Unknown player."); else {
                pInfo[plr][ClanUSA] = 1;//Change it to what you use as PlayerInfo
               }
      }
      return 1;
   }

Put this under OnPlayerSpawn(playerid,classid,teamid)
Pawno Code: [Select]
public OnPlayerSpawn(playerid,classid,teamid)
    if (pInfo[playerid][ClanUSA] = 0) {
   NickPlayerChar(playerid);
    }

Make a public NickPlayerChar(playerid)
Pawno Code: [Select]
public NickPlayerChar(playerid)
{

    if(IsInClan(gPlayers[playerid]))
   {
   SendClientMessage(playerid, COLOR_RED, "CONNECTION REJECTED");
   SendClientMessage(playerid, COLOR_RED, "YOU HAVE BEEN KICKED");
   SendClientMessage(playerid, COLOR_RED, "ADMIN: SYSTEM REASON: NOT IN CLAN USA");
   Kick(playerid);
   SendClientMessageToAll(playerid, COLOR_RED, "Admin System kicked %s. Reason: Not in clan USA",gPlayers[playerid]);
   }
}

Now make a public IsInClan(c)
Pawno Code: [Select]
public IsInClan(c&#91;])
{
   new cde[256]; cde = "CountRegisters";
   if (strfind(c, "USA", true) != -1) return 1;//Replace USA with your clan
        else return 0;
    return 1;
}


Now here you have them. Now you have a insult-free and clancheat-free server!
You might have some warnings, but ignore them its tested 100% works
23
Scripting Help / Buy And Saveskin By Aledark
« Last post by (R2x)spider on February 03, 2013, 05:43:53 pm »
Code: [Select]
      else if (strcmp(cmd, "buyskin", true) == 0) {
     tmp = strtok(cmdtext, idx);
     new Dinero = GetPlayerMoney(playerid);
         if (!strlen(tmp)) Mensaje(playerid, NARANJA,"[System] - CORRECT USE: /c buyskin <ID>.");
         else if(!NeedPlayerInArea(playerid,407.6586,424.0244,1037.5781,1040.8357)) Mensaje(playerid, NARANJA,"[Error] - Only purchase GASH Store in North Point Mall");
else {
              if (!IsNumeric(tmp)) Mensaje(playerid, ROJO,"[Error] -
Number of invalid skin");
              else if (strval(tmp) >=  107) Mensaje(playerid, ROJO,"[Error] - You can only buy up to 106.");
              else {
                     if(Dinero >= 1000) {
                   Mensaje(playerid, AMARILLO,"You bought a skin for use always use / c skin.");
                   Mensaje(playerid, AMARILLO,"You can only buy up to 106 skin.");
   SetPlayerSkin(playerid,strval(tmp));
                   DecPlayerHandCash(playerid,500);
                   SetPlayerRopaComprada(playerid,strval(tmp));
                   }
                   }
                            if(Dinero < 999) {
        SendClientMessage(playerid,AMARILLO,"The skin cost $ 1,000 can only buy up to 106 skin");
        }
}
        return 1;
}
  else if (strcmp(cmd, "skin", true) == 0) {
     tmp = strtok(cmdtext, idx);
if ( !IsLoggedIn( playerid ) ) Mensaje( playerid, ROJO, "Login first" );
         if(GetPlayerRopa(playerid))
{
SetPlayerSkin(playerid,GetPlayerRopa(playerid));
        }
        return 1;
}
need to define this
Code: [Select]
new MSN[256];
Code: [Select]
public GetPlayerRopa(playerid)
{
    format(MSN,256, REGISTROS_FILE, gPlayers[playerid]);//change to you register folder name
new ropa; ropa = dini_Int(MSN,"skin");
return ropa;
}
public SetPlayerRopaComprada(playerid,ropa)
{
    format(MSN,256, REGISTROS_FILE, gPlayers[playerid]);//change to you register folder name
dini_IntSet(MSN,"skin",ropa);
}
//==============================================================================
public Mensaje(playerid, color, text [ ])
{
new Msn[256];
format(Msn, 256, "Private Message >> %s", text);
SendClientMessage(playerid, color, Msn);
return 1;
}

//==============================================================================
stock NeedPlayerInArea(playerid,Float:MinX,Float:MaxX,Float:MinY,Float:MaxY)
{
   new Float:x,Float:y,Float:z;
       GetPlayerPos(playerid, x, y, z);
       if(x >= MinX && x <= MaxX && y >= MinY && y <= MaxY) return 1;
       else return 0;
   return 1;
}
good luck
24
Scripting Help / How To Use A Pickup And Function
« Last post by (R2x)spider on February 03, 2013, 05:42:01 pm »
if you want to make the pickup with many functions, read my article.

For a beginning:
Quote
#define JACK_WHITE 0xFFFFFFAA // Copypast to your pwn file

1st Step. To add pickup

Quote
public OnGameModeInit()
{
AddStaticPickup (1, 410, -442.8760, -315.8749, 11.1867); // Hidden Package
AddStaticPickup (2, 356, -703.3553, -411.1085, 10.5188); // Box

2nd Step. to make a function of the pickup

Quote
public OnPickedUp(playerid,pickupid)
{
if ( pickupid == 1) // Function of 1st pickup
{
SetPlayerMoney(playerid,GetPlayerMoney(playerid) + 5000); // +5.000$ to the cash
SendClientMessage(playerid, JACK_WHITE, "You picked up hidden package! Award: 5000$");
}
if ( pickupid == 2) // Function of 2nd pickup
{
SetPlayerWeapon(playerid, 21, 500); // Gives a stubby
SendClientMessage(playerid, JACK_WHITE, "You picked up box with a stubby shotgun!");
}
return 1;
}

Sorry for my english
Good Luck!
25
Scripting Help / repair the car in all spray shop by alejandro
« Last post by (R2x)spider on February 03, 2013, 05:40:22 pm »
Code: [Select]
           else if(strcmp(cmdtext, "reparar", true) == 0) {
    if(PlayerToPoint(6, playerid,-870.66674, -118.24742, 10.65336 ) || PlayerToPoint(6, playerid,-912.51165, -1268.10986, 11.86920) || PlayerToPoint(6, playerid,-11.25934, -1258.25854, 10.23682) || PlayerToPoint(6, playerid,327.91986, 430.80700, 11.16345)) {


        new cash = GetPlayerMoney(playerid);
             if(cash >= 500) {
        SendClientMessage(playerid,COLOR_YELLOW,"Has reparado tu vehiculo");
        SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
    SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
        DecPlayerCash(playerid,500);
    }
        if(cash < 499) {
        SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $500 para reparar el vehiculo!");
        }
}
        else
        {
        SendClientMessage(playerid,COLOR_YELLOW,"Solo se repara en Pay N Spray");
        }
    return 1;
}
this is for warcheif
Code: [Select]
else if(strcmp(cmdtext, "reparar", true) == 0) {
    if(PlayerToPoint(6, playerid,-870.66674, -118.24742, 10.65336 ) || PlayerToPoint(6, playerid,-912.51165, -1268.10986, 11.86920) || PlayerToPoint(6, playerid,-11.25934, -1258.25854, 10.23682) || PlayerToPoint(6, playerid,327.91986, 430.80700, 11.16345)) {


        new cash = GetPlayerMoney(playerid);
             if(cash >= 500) {
        SendClientMessage(playerid,COLOR_YELLOW,"Has reparado tu vehiculo");
        SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
    SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
        DecPlayerHandCash(playerid,500);
    }
        if(cash < 499) {
        SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $500 para reparar el vehiculo!");
        }
}
        else
        {
        SendClientMessage(playerid,COLOR_YELLOW,"Solo se repara en Pay N Spray");
        }
    return 1;
}
this is for gups
Code: [Select]
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
        return 1;
    }
    return 0;
}
//==============================================================================
stock
need help free 2 ask
26
Scripting Help / Rob CMds By Aledark
« Last post by (R2x)spider on February 03, 2013, 05:38:10 pm »
Code: [Select]
new Billetera[MAX_PLAYERS];
Code: [Select]
  else if (strcmp(cmd, "rob", true) == 0) {
tmp = strtok( cmdtext, idx ); new plr = FindPlayerIDFromString( tmp );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: /c rob [Nick/ID]" );
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else if ( !IsPlayerSpawned( plr ) ) SendClientMessagef( playerid, COLOR_GREEN, "Error: %s does not spawned!", gPlayers[ plr ] );
       else if(!NeedPlayerInArea(playerid,-1120.6895,-809.5638,-693.6281,-137.1244)) SendClientMessage(playerid, GREEN,"[Error] - You can only steal in an area near the bank");
  else {
 
              new Float:RX, Float:RY, Float:RZ, szMsg[256];
                  GetPlayerPos(playerid,RX,RY,RZ);
                  if(PlayerToPoint(3.0,plr,RX,RY,RZ))
                  format( szMsg, sizeof( szMsg ), "%s is stealing the wallet of %s", gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll( COLOR_RED, szMsg );
  SetTimer("robando", 7000, false);
                  TogglePlayerControllable(playerid,0);
                  IncPlayerHandCash(playerid,150);
  DecPlayerHandCash(plr,150);
Billetera[playerid] = 1;
  SetPlayerMarker(playerid,15);
}
return 1;
}
Code: [Select]
stock NeedPlayerInArea(playerid,Float:MinX,Float:MaxX,Float:MinY,Float:MaxY)
{
   new Float:x,Float:y,Float:z;
       GetPlayerPos(playerid, x, y, z);
       if(x >= MinX && x <= MaxX && y >= MinY && y <= MaxY) return 1;
       else return 0;
   return 1;
}
//==============================================================================
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetPlayerPos(playerid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
        return 1;
    }
    return 0;
}
//==============================================================================
public robando() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
    if(Billetera[i] == 0) {
    }
    if(Billetera[i] == 1) {
           SendClientMessage(i,COLOR_YELLOW,"You have been seen, Escape immediately!");
           TogglePlayerControllable(i,1);

  }
}
}
}
Need Help Free 2 ask
27
Scripting Help / Engine off or on system by NeskWriter
« Last post by (R2x)spider on February 03, 2013, 05:36:32 pm »
Code: [Select]
public OnPlayerText(playerid, text&#91;])
{
if(strcmp(text, "!enoff", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
    KillVehicleEngine(vehicleid);
    SendClientMessage(playerid, 0xFF0000AA, "The engine has been turned off.");
    GameTextForPlayer(playerid, "~o~            OFF");
    return 1;
}
else
{
    SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle.");
    return 1;
}
    return 1;
}
else if(strcmp(text, "!enon", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
RemovePlayerFromVehicle(playerid);
PutPlayerInVehicle(playerid, vehicleid);
SendClientMessage(playerid, 0xFF0000AA, "The engine has been turned on.");
GameTextForPlayer(playerid, "~t~            ON");
return 0;
}
else
{
    SendClientMessage(playerid, 0xFF0000AA, "You are not in a vehicle.");
    return 0;
}
Need Help Free 2 Ask
28
Scripting Help / Anti-Insult For Server Protection By Doom
« Last post by (R2x)spider on February 03, 2013, 05:35:13 pm »
top of script
Code: [Select]
#define MAX_WORD_LEN 18 // Max lenght of a swear word
#define MAX_WORDS 122   // Max amount of swearwords
#define MAX_SWEARCOUNT 5 // Max warnings before kick
Code: [Select]
new swear[][MAX_WORD_LEN] =
{
{"anus"},
{"****"},
{"ass"},
{"****"},
{"blowjob"},
{"boner"},
{"bullshit"},
{"clit"},
{"****"},
{"cum"},
{"****"},
{"dick"},
{"dildo"},
{"douche"},
{"fag"},
{"fellatio"},
{"****"},
{"fudgepacker"},
{"gay"},
{"damn"},
{"gooch"},
{"handjob"},
{"hard-on"},
{"homo"},
{"homodumbshit"},
{"humping"},
{"jerkoff"},
{"jigaboo"},
{"jizz"},
{"jungle-bunny"},
{"junglebunny"},
{"kooch"},
{"kootch"},
{"kunt"},
{"kyke"},
{"lesbian"},
{"lesbo"},
{"lezzie"},
{"mcfagget"},
{"minge"},
{"mothafucka"},
{"motherfucker"},
{"motherfucking"},
{"muff"},
{"muffdiver"},
{"munging"},
{"negro"},
{"*****"},
{"niglet"},
{"nutsack"},
{"paki"},
{"panooch"},
{"pecker"},
{"peckerhead"},
{"****"},
{"****"},
{"polesmoker"},
{"pollock"},
{"poonani"},
{"porchmonkey"},
{"prick"},
{"punanny"},
{"punta"},
{"pussies"},
{"****"},
{"pussylicking"},
{"puto"},
{"queef"},
{"renob"},
{"rimjob"},
{"ruski"},
{"sand******"},
{"****"},
{"scrote"},
{"****"},
{"shiz"},
{"shiznit"},
{"skank"},
{"skullfuck"},
{"****"},
{"slutbag"},
{"smeg"},
{"snatch"},
{"tard"},
{"testicle"},
{"thundercunt"},
{"tit"},
{"twat"},
{"twatwaffle"},
{"unclefucker"},
{"vag"},
{"****"},
{"vjayjay"},
{"wank"},
{"****"},
{"whorebag"},
{"whoreface"},
{"wop"},
{"@gmail"},
{"@live"},
{"@msn"},
{"@hotmail"},
{".de"},
{".cc"},
{"www."},
{".com"},
{".co"},
{".uk"},
{".org"},
{".net"},
{".info"},
{".tk"}
};
Code: [Select]
public OnPlayerText(playerid, cmdtext[])
{
if((strlen(cmdtext) < 3) || (cmdtext[0] == '/') || (cmdtext[0] == '#') || (cmdtext[0] == '!')) return 1;

new offset;
new len;
  for(new i=0; i<MAX_WORDS; i++)
{
offset = strfind(cmdtext, swear[i], true);
if(offset > -1)
{
len = strlen(swear[i]);
if(len < 3) break;
for(new y=0; y<len; y++)
{
cmdtext[offset+y] = '*';
}
swearCount[playerid]++;
new string[64];
format(string, sizeof(string), "Swearing is not allowed here, warning %d/%d", swearCount[playerid], MAX_SWEARCOUNT);
SendClientMessage(playerid, 0xE60000FF, string);
    if(swearCount[playerid] >= MAX_SWEARCOUNT)
{
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "*** %s has been kicked for offensive language", name);
    SendClientMessageToAll(0xE60000FF, string);
    Kick(playerid);
    break;
}
break;
}
}
return 1;
}

Need Help To Install Free To Ask
29
Scripting Help / Ids And Callbacks functions For scripting
« Last post by (R2x)spider on February 03, 2013, 05:31:44 pm »
here is vrocker website

Information you might need for Pawn scripting can be found on this wiki:
http://thijn.vrocker-hosting.co.uk/VCWiki/index.php/Main_Page

(kindly hosted by Thijn and VRocker Hosting)


Pawn Functions
Callbacks (Events)
Functions

IDs
Radar Icons
Skins
Vehicles
Weapons
Pickups

Colors
Car Colors
Team Colors

Codes for Game Text
30
Clan Changer / MOVED: NEW YORK BOYZ
« Last post by (R2x)spider on February 03, 2013, 05:29:10 pm »
Pages: 1 2 [3] 4 5