RGZ Gaming Forum


 
AcasaUltimele imaginiCăutareÎnregistrareConectare

Distribuiţi|

Christmas tree system load/save

Vezi subiectul anterior Vezi subiectul urmator In jos
AutorMesaj
Agnostic
Moderator
Agnostic

Rank: Moderator
Status:
Posturi : 1146
Reputatie : 36
Data de Inscriere : 09/02/2014
Oras : RGZ City
Varsta : 25
Christmas tree system load/save  Empty
MesajSubiect: Christmas tree system load/save Christmas tree system load/save  EmptyJoi Iul 31, 2014 11:56 am

Am facut un sistem de pomi de craciun.
Sistemul functioneaza cu mysql r34 si zcmd.
Fara pluginul mysql nu merge.
Sper sa va bucurati de el.
Script:

#if defined Credits
( "Script maked by The RoW !" )
#endif

#include " a_samp "
#include " zcmd "
#include " a_mysql "

#define Host "localhost" // daca il pornesti de pe pc il lasi asa daca nu schimbi cu ip de la hostul phpmyadmin
#define User "root" // la fel ca sus doar ca pui numele de utilizator
#define DataBase "rtree" // numele database-ului
#define PassWord "" // parola in cazul in care aveti

new rHandle = -1 , LastTreeID ;

public OnFilterScriptInit()
{
rHandle = mysql_connect( Host , User , DataBase , PassWord );
mysql_tquery( rHandle , "SELECT * FROM `ctree`" , "LoadTree" , "" );

print("\n_____________________________________");
print(" rTree Loaded ");
print("_____________________________________\n");

return ( 1 );
}

public OnFilterScriptExit( )
return mysql_close( rHandle );


CMD:createtree( playerid )
{
new Float: Pos[ 3 ] ;

if( !IsPlayerAdmin( playerid ) )
return SendClientMessage( playerid , -1 , "Tu nu esti admin RCON !" );

GetPlayerPos( playerid , Pos[ 0 ] , Pos[ 1 ] , Pos[ 2 ] );
CreateChristmasTree( Pos[ 0 ] , Pos[ 1 ] , Pos[ 2 ] );
SendClientMessage( playerid , -1 , "Ai creat un pom de craciun." );

return ( 1 );
}

forward LoadTree( );
public LoadTree( )
{
new Get[ 2 ] , Float:TreePos[ 3 ];
cache_get_data( Get[ 0 ] , Get[ 1 ] , rHandle );

if( !Get[ 0 ] )
return print( "Tu nu ai pomi in Database." );

for( new i ; i < Get[ 0 ] ; i++ )
{
TreePos[ 0 ] = cache_get_field_content_float( i , "cTx" , rHandle );
TreePos[ 1 ] = cache_get_field_content_float( i , "cTy" , rHandle );
TreePos[ 2 ] = cache_get_field_content_float( i , "cTz" , rHandle );
LoadChristmasTree( TreePos[ 0 ] , TreePos[ 1 ] , TreePos[ 2 ] );
LastTreeID ++;
}
printf( "[ > rTree < ]: Au fost loadati %d pomi de craciun !" , LastTreeID );
return ( 1 );
}

stock CreateChristmasTree( Float:X , Float:Y , Float:Z ) // Ty maxtorcd55 for base function !
{
new xStr[ 128 ];
LastTreeID += 1;
CreateObject(3472,X+0.28564453,Y+0.23718262,Z+27.00000000,0.00000000,0.00000000,230.48021);
CreateObject(664,X+0.20312500,Y+0.01171875,Z+-3.00000000,0.00000000,0.00000000,0.00000000);
CreateObject(3472,X+0.45312500,Y+0.51562500,Z+4.00000000,0.00000000,0.00000000,69.7851562);
CreateObject(3472,X+0.65136719,Y+1.84570312,Z+17.00000000,0.00000000,0.00000000,41.863403);
CreateObject(7666,X+0.34130859,Y+0.16845703,Z+45.00000000,0.00000000,0.00000000,298.12524);
CreateObject(7666,X+0.34082031,Y+0.16796875,Z+45.00000000,0.00000000,0.00000000,27.850342);
CreateObject(3472,X+0.45312500,Y+0.51562500,Z+12.00000000,0.00000000,0.00000000,350.02441);
CreateObject(3472,X+0.45312500,Y+0.51562500,Z+7.00000000,0.00000000,0.00000000,30.0805664);
CreateObject(3472,X+0.45312500,Y+0.51562500,Z+22.00000000,0.00000000,0.00000000,230.47119);
CreateObject(1262,X+0.15039062,Y+0.57128906,Z+29.45285416,0.00000000,0.00000000,162.90527);

format( xStr , 128 , "INSERT INTO `ctree` ( TreeID , cTx , cTy , cTz ) VALUES ( %d , %f , %f , %f )" , LastTreeID , X , Y , Z );
mysql_tquery( rHandle , xStr , "" , "" );

print( "[ > rTree < ]: Ai creeat un nou pom de craciun.");

return ( 1 );
}

stock LoadChristmasTree( Float:X , Float:Y , Float:Z ) // Ty maxtorcd55 !
{
CreateObject(3472,X+0.28564453,Y+0.23718262,Z+27.00000000,0.00000000,0.00000000,230.48021);
CreateObject(664,X+0.20312500,Y+0.01171875,Z+-3.00000000,0.00000000,0.00000000,0.00000000);
CreateObject(3472,X+0.45312500,Y+0.51562500,Z+4.00000000,0.00000000,0.00000000,69.7851562);
CreateObject(3472,X+0.65136719,Y+1.84570312,Z+17.00000000,0.00000000,0.00000000,41.863403);
CreateObject(7666,X+0.34130859,Y+0.16845703,Z+45.00000000,0.00000000,0.00000000,298.12524);
CreateObject(7666,X+0.34082031,Y+0.16796875,Z+45.00000000,0.00000000,0.00000000,27.850342);
CreateObject(3472,X+0.45312500,Y+0.51562500,Z+12.00000000,0.00000000,0.00000000,350.02441);
CreateObject(3472,X+0.45312500,Y+0.51562500,Z+7.00000000,0.00000000,0.00000000,30.0805664);
CreateObject(3472,X+0.45312500,Y+0.51562500,Z+22.00000000,0.00000000,0.00000000,230.47119);
CreateObject(1262,X+0.15039062,Y+0.57128906,Z+29.45285416,0.00000000,0.00000000,162.90527);

return ( 1 );
}


DataBase:

CREATE TABLE IF NOT EXISTS `ctree`
(
`TreeID` int(11) NOT NULL AUTO_INCREMENT,
`cTx` float NOT NULL,
`cTy` float NOT NULL,
`cTz` float NOT NULL,
PRIMARY KEY (`TreeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Sus In jos
FLEWEENTE
Moderator
FLEWEENTE

Rank: Moderator
Status:
Posturi : 537
Reputatie : 13
Data de Inscriere : 05/08/2014
Oras : ORAS RGZ
Varsta : 27
Christmas tree system load/save  Empty
MesajSubiect: Re: Christmas tree system load/save Christmas tree system load/save  EmptyDum Aug 17, 2014 8:53 am

Shocked
Sus In jos

Christmas tree system load/save

Vezi subiectul anterior Vezi subiectul urmator Sus

Subiecte similare

-
t Tree Mod
t Celine Dion-So this is Christmas
t Ionut System-Du-te,du-te
t DeathRun Vip System
t Siren System
Pagina 1 din 1

Permisiunile acestui forum:Nu puteti raspunde la subiectele acestui forum
RGZ Gaming Forum  :: »[RGZ] Gaming :: Gta San Andreas :: Scripturi-