Nope Broh I am Owner Of Server
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: r4d0n on Jul 28, 2017, 11:22 AMDunno how the forum mods can have such patience with these kind of newbies... Doesn't even know english propely...
Quote from: sseebbyy on Apr 12, 2017, 10:05 PM4. onPlayerCommand( player, command, text )local cmd = command.tolower();
else if( cmd == "addprop" )
{
if( !text ) return pMSG( "Error - Syntax: /" + cmd + " <price> <name>", player );
else if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
else if( NumTok( text, " " ) < 2 ) return pMSG( "Error - Syntax: /" + cmd + " <price> <name>", player );
else if( typeof( GetTok( text, " ", 1 ).tointeger() ) != "integer" ) return pMSG( "Error - Usually 'price' means numbers...", player );
else if( GetTok( text, " ", 2, NumTok( text, " " ) ).tolower() == "default" ) return pMSG( "Error - The name 'default' cannot be used.", player );
else
{
local price = GetTok( text, " ", 1 ).tointeger(),
name = GetTok( text, " ", 2, NumTok( text, " " ) );
CreateProperty( name, price, player.Pos.x, player.Pos.y, player.Pos.z, player.World )
pMSG( "[dbProperties]: Property " + name + " was created.", player);
}
}
else if( cmd == "delprop" )
{
local lp = lastPickupPickedUp[ player.ID ],
pos, plp, lpid;
if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
else if( lp == null ) return pMSG( "Error - You must be near property.", player );
else
{
if( !FindPickup( lp ) ) return pMSG( "Error - Pickup no longer exists..", player );
else
{
plp = FindPickup( lp );
lpid = plp.ID;
pos = plp.Pos;
if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - You must be near property.", player );
else
{
pMSG( "Done! You removed property: " + prop[ lpid ].Name, player );
RemoveProperty( plp );
}
}
}
}
else if( cmd == "myprops" )
{
pMSG( "Your owned properties: " + RGB_GREY + OwnedProperties( player ), player );
pMSG( "Your shared properties: " + RGB_GREY + SharedProperties( player ), player );
}
else if( cmd == "buyprop" )
{
local lp = lastPickupPickedUp[ player.ID ],
pos, plp, lpid;
if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
else if( lp == null ) return pMSG( "Error - There is no property around.", player );
else
{
if( !FindPickup( lp ) ) return pMSG( "Error - There is no property around.", player );
else
{
plp = FindPickup( lp );
lpid = plp.ID;
pos = plp.Pos;
if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - There is no property around.", player );
else if( prop[ lpid ].Owner != NO_OWNER_MSG ) return pMSG( "Error - This property is not forsale.", player );
else if( player.Cash < prop[ lpid ].Price ) return pMSG( "Error - Not enough money.", player );
else
{
pMSG( "Congratz! You bought " + RGB_GREY + prop[ lpid ].Name + RGB_BLUE + " for " + RGB_GREY + prop[ lpid ].Price + RGB_BLUE + " !", player );
player.Cash -= prop[ lpid ].Price;
UpdateProperty( lpid, prop[ lpid ].Name, prop[ lpid ].Price, player.Name, NO_SHARING_MSG, NO_DESCRIPTION_MSG, pos.x, pos.y, pos.z, plp.World );
ReloadProperty( plp, PROP_MODEL_BOUGHT );
}
}
}
}
else if( cmd == "sellprop" )
{
local lp = lastPickupPickedUp[ player.ID ],
pos, plp, lpid;
if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
else if( lp == null ) return pMSG( "Error - There is no property around.", player );
else
{
if( !FindPickup( lp ) ) return pMSG( "Error - There is no property around.", player );
else
{
plp = FindPickup( lp );
lpid = plp.ID;
pos = plp.Pos;
if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - There is no property around.", player );
else if( prop[ lpid ].Owner != player.Name ) return pMSG( "Error - You don't own this property.", player );
else
{
pMSG( "Done! " + RGB_GREY + prop[ lpid ].Name + RGB_BLUE + " was sold for " + RGB_GREY + prop[ lpid ].Price + RGB_BLUE + " !", player );
player.Cash += prop[ lpid ].Price;
UpdateProperty( lpid, prop[ lpid ].Name, prop[ lpid ].Price, NO_OWNER_MSG, NO_SHARING_MSG, NO_DESCRIPTION_MSG, pos.x, pos.y, pos.z, plp.World );
ReloadProperty( plp, PROP_MODEL_FORSALE );
}
}
}
}
else if( cmd == "shareprop")
{
if( !text ) return pMSG( "Error - Syntax: /" + cmd + " <player>", player );
else
{
local propid = lastPickupPickedUp[ player.ID ],
plr = FindPlayer( text );
if( !plr ) return pMSG( "Error - Unknown/Offline player.", player );
else if( !propid ) return pMSG( "Error - There is no property around.", player );
else if( !FindPickup( propid ) ) return pMSG( "Error - There is no property around.", player );
else if( player.Name != prop[ propid ].Owner ) return pMSG( "Error - You don't own this property.", player );
else if( !PlayerToPoint( player, 1, prop[ propid ].x, prop[ propid ].y, prop[ propid ].z ) ) return pMSG( "Error - There is no property around.", player );
else if( !PlayerToPoint( plr, 3, player.Pos.x, player.Pos.y, player.Pos.z ) ) return pMSG( "Error - Player must be near you.", player );
else if( player.ID == plr.ID ) return pMSG( "Error - Come on.. make room for others.", player );
else if( prop[ propid ].Sharing == plr.Name ) return pMSG( "Error - You are already sharing it with " + plr.Name, player );
else
{
UpdateProperty( propid, prop[ propid ].Name, prop[ propid ].Price, player.Name, plr.Name, prop[ propid ].Description, prop[ propid ].x, prop[ propid ].y, prop[ propid ].z, prop[ propid ].World );
pMSG( "Done! You are now sharing " + RGB_GREY + prop[ propid ].Name + RGB_BLUE + " with " + RGB_GREY + prop[ propid ].Sharing + RGB_BLUE + " !", player );
pMSG( "Woah! " + RGB_GREY + player.Name + RGB_BLUE + " just shared '" + RGB_GREY + prop[ propid ].Name + RGB_BLUE + "' with you !", plr );
}
}
}
else if( cmd == "unshareprop" )
{
local propid = lastPickupPickedUp[ player.ID ],
pos = FindPickup( propid ).Pos;
if( !propid ) return pMSG( "Error - There is no property around.", player );
else if( !FindPickup( propid ) ) return pMSG( "Error - Property does not exist.", player );
else if( player.Name != prop[ propid ].Owner ) return pMSG( "Error - You don't own this property.", player );
else if( !PlayerToPoint( player, 1, prop[ propid ].x, prop[ propid ].y, prop[ propid ].z ) ) return pMSG( "Error - There is no property around.", player );
else if( prop[ propid ].Sharing == NO_SHARING_MSG ) return pMSG( "Error - You didn't share this property, yet.", player );
else
{
UpdateProperty( propid, prop[ propid ].Name, prop[ propid ].Price, player.Name, NO_SHARING_MSG, prop[ propid ].Description, prop[ propid ].x, prop[ propid ].y, prop[ propid ].z, prop[ propid ].World );
pMSG( "Done! You are not anymore sharing " + RGB_GREY + prop[ propid ].Name + RGB_BLUE + " !", player );
}
}
5. onPickupPickedUp( player, pickup )if( pickup.Model == 407 || pickup.Model == 406 )
{
if( prop[ pickup.ID ] != null )
{
local id = pickup.ID,
propid = prop[ id ].ID,
name = prop[ id ].Name,
price = prop[ id ].Price,
owner = prop[ id ].Owner,
sharing = prop[ id ].Sharing,
description = prop[ id ].Description;
lastPickupPickedUp[ player.ID ] = id;
return pMSG( "Property ID: " + RGB_GREY + propid + RGB_BLUE + " Name: " + RGB_GREY + name + RGB_BLUE + " Price: " + RGB_GREY + price + RGB_BLUE + " Owner: " + RGB_GREY + owner + RGB_BLUE + " Sharing: " + RGB_GREY + sharing + RGB_BLUE + " Description: " + RGB_GREY + description, player );
}
}
[spoiler=PlayerToPoint() function if you don't have it]function PlayerToPoint( player, radi, x, y, z )
[/spoiler]
{
local tempposx, tempposy, tempposz;
tempposx = player.Pos.x -x;
tempposy = player.Pos.y -y;
tempposz = player.Pos.z -z;
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
PS: To buy/sell/del/share/unshare a property you need to be near it's pickup.
PS2: You must place CreateProperties before any other CreatePickup() !
PS3: Limits and Database location is specified in top of BasicPropertySystem.nut.
(be sure you know what you doin' when changing those constants
Quote from: KAKAN on Jul 27, 2017, 10:14 AMQuote from: Cool on Jul 27, 2017, 07:01 AMYessssss I loveee increasing my posts i am best spammer over the forum.Never.
Any problem? actually i want to beat @KAKAN post count