Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Cyanide - 12.06.2011
→ 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 foundYou'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.
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Donya - 12.06.2011
good job. i will use it as a base on something
thanks
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
lolumadd_ - 12.06.2011
Nice, but can players just make tags floating in mid air? How do you detect that he is aiming at a wall?
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Cyanide - 12.06.2011
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.
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Donya - 12.06.2011
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
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Cyanide - 12.06.2011
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.
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Donya - 12.06.2011
sorry, didn't get that. :P
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Lorenc_ - 13.06.2011
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!
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
justsomeguy - 13.06.2011
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)
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Cyanide - 13.06.2011
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;
}
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
justsomeguy - 13.06.2011
Код:
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.
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Cyanide - 13.06.2011
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.
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
BaubaS - 13.06.2011
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)
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Jack_Rocker - 13.06.2011
Good include my friend!
[noob]This forum requires that you wait 120 seconds between posts. Please try again in 66 seconds.[/noob]
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Cyanide - 14.06.2011
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.
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
BASITJALIL - 14.06.2011
WOW This is awesome
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Ricop522 - 14.06.2011
awesome but sql and GVars isn't so cool to install the plugin on the serv
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Cyanide - 14.06.2011
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.
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Cyanide - 16.06.2011
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"
};
Re: Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) -
Ricop522 - 18.06.2011
This detect if he's at the wall ?