[Include] Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support)
#1

→ About

Cyanide's Gang Spray/Tag System was inspired by GTA:SA mission Tagging Up Turf. A summary of the link is that Sweet and CJ find multiple Ballas tags and over-spray them with their families' tag. This is my first release, and in my opinion it's a bit cheesy. Everyone improves.

→ Advantages
  • Plug N' Play
  • Loading and Saving (SQLite)
  • Spraying Permission
  • Useful Callbacks
→ Disadvantages
  • Inaccurate Wall Accurancy (Not detectable in SA:MP)
→ Optional Callbacks

pawn Код:
public OnPlayerReceiveSprayPermission( playerid, errorID )
{
      if( !errorID )
          printf("clientid %i has just received spraying permission.", playerid);
 
      return true;
}

public OnPlayerCreateSpray( playerid, sprayID )
{
      printf( "SprayID: %i has been created.", sprayID );
      static
            s_string[ 100 ],
            File: log
      ;
      GetPlayerName( playerid, s_string, MAX_PLAYER_NAME );
      format( s_string, sizeof s_string, "%s|%i", s_string, gettime( ) );

      log = fopen( "spray_log.log", fexist( "spray_log.log " ) ? io_append : io_open );
      fwrite( log, s_string );
      fclose( log );
}

public OnSprayDelete( sprayID )
{
      printf( "SprayID: %i has been deleted.", sprayID );
      return true;
}
→ Functions

pawn Код:
Spray::givePlayerPermission( clientid, bool:permissionToggle ) -        Allows you to give permission to a sprayer.
Spray::createSprayAtPlayerPos( clientid ) -                             Creates a spray at the player's position.
Spray::Delete( sprayID ) -                                              Deletes a spray.
Spray::Load( ) -                                                        Loads sprays, already called on server start.
Spray::doesPlayerHavePermission( clientid ) -                           Checks if a player has spraying permission.
Spray::UpdateTag( sprayID, sprayTag )                                   Updates a tag'
s spray, refer to the codes below.
→ Codes


pawn Код:
SPRAY_TAG_FYB_1                                                         Front Yard Ballas
SPRAY_TAG_FYB_2                                                         Front Yard Ballas 2
SPRAY_TAG_FYB_3                                                         Front Yard Ballas 3
SPRAY_TAG_RIFA                                                          San Fierro Rifa
SPRAY_TAG_RHB                                                           Rollin Heights Ballas
SPRAY_TAG_SEVILLE                                                       Seville Families
SPRAY_TAG_TEMPLE                                                        Temple Drive
SPRAY_TAG_AZTECAS                                                       Aztecas
→ Video

[ame]http://www.youtube.com/watch?v=0zTWUJuhtHk[/ame]
The night-time scenery music is low.
→ Download

.inc download.
YSI package download
GVar Plugin Download

→ FAQ

File or function is not found
You're missing the gvar plugin. Download the Gvar plugin in the downloads section of this thread and load it properly. If it's loaded but you still get the error, the problem is with the script you're including this include into to.
Why isn't anything spraying?
You're required to be equipped with a spray can weapon (weaponID 41). Once you're equipped, spray the tag you want against the wall, if nothing happens make sure you give the player permission by using the function Spray::givePlayerPermission. If you're unsure where to put this, simply put it in OnPlayerConnect. A example is below:
pawn Код:
public OnPlayerConnect( playerid )
{
     Spray::givePlayerPermission( playerid, true );
     return true;
}
→ Credits

Код:
Cyanide - 		Project Launcher & Developer
Bakr - 			Helping with trigonometry functions.
****** -                YSI
Incognito -             Global Variable plugin.
SA-MP Team -     	San Andreas Multiplayer Modification.
Reply
#2

good job. i will use it as a base on something thanks
Reply
#3

Nice, but can players just make tags floating in mid air? How do you detect that he is aiming at a wall?
Reply
#4

Quote:
Originally Posted by lolumadd_
Посмотреть сообщение
Nice, but can players just make tags floating in mid air? How do you detect that he is aiming at a wall?
Please take a look into the disadvantage section on my topic post. Also I didn't bother even detecting mid air movement due to myself feeling unreasonable for adding MapAndreas which takes alot of memory just for a small disadvantage. That's why I added the permission feature.
Reply
#5

Quote:
Originally Posted by Cyanide
Посмотреть сообщение
Please take a look into the disadvantage section on my topic post. Also I didn't bother even detecting mid air movement due to myself feeling unreasonable for adding MapAndreas which takes alot of memory just for a small thing. That's why I added the permission feature.
you can use mapandreas to detect that one, about 92% accurate
Reply
#6

Quote:
Originally Posted by Donya
Посмотреть сообщение
you can use mapandreas to detect that one, about 92% accurate
Quote:
Originally Posted by Cyanide
Посмотреть сообщение
Please take a look into the disadvantage section on my topic post. Also I didn't bother even detecting mid air movement due to myself feeling unreasonable for adding MapAndreas which takes alot of memory just for a small disadvantage. That's why I added the permission feature.
I edited my post, you must of not caught it.
Reply
#7

sorry, didn't get that. :P
Reply
#8

This is so damn EPIC! Infact i might even use this for my other upcoming server and have it compatible with my gang script.

Thanks so much!
Reply
#9

I've seen this idea before but that one was crap this one is epic!

EDIT:
Oke sow i have tried it but now i have one question:
How do i make like when i just sprayed on a wall that a dialog pops up?(Like in your vid)
Reply
#10

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
I've seen this idea before but that one was crap this one is epic!

EDIT:
Oke sow i have tried it but now i have one question:
How do i make like when i just sprayed on a wall that a dialog pops up?(Like in your vid)
Thanks for your comment! You need to set the permission using the function Spray::givePlayerPermission. This is an example that allows all players who connect permission to spray:

pawn Код:
public OnPlayerConnect( playerid )
{
     Spray::givePlayerPermission( playerid, true );
     return true;
}
Reply
#11

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\pawno\include\YSI\y_stringhash.inc(669) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Program Files\Rockstar Games\GTA San Andreas\pawno\include\YSI\y_stringhash.inc(695) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Program Files\Rockstar Games\GTA San Andreas\pawno\include\YSI\y_stringhash.inc(721) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\RcRP.pwn(722) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
Well thats weird. I cant remember having those the last time.
Reply
#12

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\pawno\include\YSI\y_stringhash.inc(669) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Program Files\Rockstar Games\GTA San Andreas\pawno\include\YSI\y_stringhash.inc(695) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Program Files\Rockstar Games\GTA San Andreas\pawno\include\YSI\y_stringhash.inc(721) : warning 219: local variable "hash" shadows a variable at a preceding level
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\RcRP.pwn(722) : warning 217: loose indentation
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\RcRP.pwn(1311) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
Well thats weird. I cant remember having those the last time.
It seems the YSI library is conflicting with your script. Either you have to rename the variables in your script or in the YSI package. I suggest renaming the variables in your script because renaming variables in YSI can cause a huge problem with the library.
Reply
#13

Nice, really unique and useful for roleplay servers. Also, you should create version which uses .ini files, because there arent so much people who uses SQLite, MySQL.. Most of them uses .ini files(I mean dini, y_ini etc)
Reply
#14

Good include my friend!

[noob]This forum requires that you wait 120 seconds between posts. Please try again in 66 seconds.[/noob]
Reply
#15

Quote:
Originally Posted by BaubaS
Посмотреть сообщение
Nice, really unique and useful for roleplay servers. Also, you should create version which uses .ini files, because there arent so much people who uses SQLite, MySQL.. Most of them uses .ini files(I mean dini, y_ini etc)
Thanks for the comment. Also if you didn't know or not: MySQL is not SQLite. SQLite doesn't force you to have to worry or not about database connection(s) to run basic queries, and plugin nonsense. SQLite has no disadvantage from using Y_Ini / dini besides that fact you cannot read them without a SQLite manager.
Reply
#16

WOW This is awesome
Reply
#17

awesome but sql and GVars isn't so cool to install the plugin on the serv
Reply
#18

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
awesome but sql and GVars isn't so cool to install the plugin on the serv
Thanks for your comment, [sarcasm]but I didn't know installing plugins was cool or not[/sarcasm]. This include isn't using a MySQL plugin, it's using SQLite. Quoted from what I said above:

Quote:

Also if you didn't know or not: MySQL is not SQLite

I could of used the property natives instead of the G-Variable plugin, in fact I might release another version replacing the G-Var plugin with the property natives. Either way it's better to use the Gvar or the property natives because it gives you tons of advantages. A good example of an advantage is this include, since I installed the Gvar plugin you're able to create a infinite amount of sprays, instead of limiting due to a array. Another advantage is that many script downloaders use unoptimized scripts and if I didn't use a the gvar plugin or property natives, their script would of possibly been overloaded on memory.
Reply
#19

I have uploaded another version (v 1.1). Due to popular request of MapAndreas, I have not added it but have checked for animations detecting a player is not on the ground. The new addition seems to be working properly.

If you noticed I missed a animation that detects if a player is on the ground or not, you can add them yourself to lines 74 to 84. A example of adding a new animation is below:

Original
pawn Код:
stock
    jump_anims[ ][ ] =
    {
        "JUMP_glide",
        "JUMP_land",
        "JUMP_launch",
        "JUMP_launch_R",
        "FALL_FALL"
    };
New
pawn Код:
stock
    jump_anims[ ][ ] =
    {
        "JUMP_glide",
        "JUMP_land",
        "JUMP_launch",
        "JUMP_launch_R",
        "FALL_FALL",
        "MyNewAnimation"
    };
Reply
#20

This detect if he's at the wall ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)