Author Topic: How to add properties and pickup's for them ?  (Read 2769 times)

0 Members and 1 Guest are viewing this topic.

Offline Dawood136

  • Street Thug
  • *
  • Posts: 28
    • View Profile
How to add properties and pickup's for them ?
« on: March 25, 2011, 09:54:34 am »
How to add properties and pickup's for them ? can any one telllllllllllllll  meeeeeeeeeeeeeeeeeeeee
Signed,
Dawood Sahi
DSS RPG Owner/Leader

Offline Skirmant

  • Made Man
  • ***
  • Posts: 134
    • View Profile
Re: How to add properties and pickup's for them ?
« Reply #1 on: March 25, 2011, 09:35:59 pm »
By properties do you mean actual territories that you can buy and sell when you're in them?
Or just a place to spawn a pickup at to create the impression that the local territory is a property?
Could you also tell me the scripting language you want to pull this of on?
 
« Last Edit: March 25, 2011, 09:38:35 pm by Skirmant »

yazeen

  • Guest
Re: How to add properties and pickup's for them ?
« Reply #2 on: March 26, 2011, 10:55:42 am »
Ok Dawood Your Using So here you go
Delete These Lines:

Code: [Select]
#define Pickups             "/Pickups/Pickups.ini"
Code: [Select]
}
else if (strcmp(cmd, "addprop", true) == 0) {
    new name[100];
    tmp = strtok(cmdtext, idx), name = strtok(cmdtext, idx);
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if(!IsPlayerCommandLevel(playerid,"addprop")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
else if (!strlen(name)) SendClientMessage(playerid,COLOR_GREEN, "USAGE: /c addprop [Price] [Name]");
else {
new Float:X,Float:Y,Float:Z, szMsg[256];
GetPlayerPos(playerid,X,Y,Z);
AddStaticPickup(1,407,X,Y,Z);
format(szMsg,sizeof(szMsg),"Property added! Price:[ $%s ] Name:[ %s ]",tmp,name);
SendClientMessage(playerid, COLOR_GREEN, szMsg);
}
return 1;
}

Code: [Select]
}
    else if (strcmp(cmd, "!pdistance", true) == 0) {
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_GREEN, "USAGE: !pdistance [PropertyID]");
else {
new contvvb[4][128];
    split(dini_Get("/Pickups/Pickups.ini",tmp), contvvb, ' ');

format(szMsg,sizeof(szMsg),"Distance between:[ %s ] and pickup:[ %d ]: %d meters",gPlayers[playerid],strval(tmp),GetDistance(playerid,floatstr(contvvb[1]),floatstr(contvvb[2]),floatstr(contvvb[3])));
SendClientMessageToAll(BLUE, szMsg);
}
return 1;
    }

Code: [Select]
LoadPickups();
Code: [Select]
public PlayerPropDistance(playerid,propid[],distance)
{
new as[4][128];
    split(dini_Get("/Pickups/Pickups.ini",propid), as, ' ');

return (GetDistance(playerid,floatstr(as[1]),floatstr(as[2]),floatstr(as[3])) >= distance) ? false : true;
}


Code: [Select]
public LoadPickups()
{
print("Loading pickups, please wait...");
new PU;
if(!dini_Exists(Pickups)) return -1;
new data[4][256];
for (PU=1; PU<=250; PU++) {
new pos[256],fm[3];
format(fm,sizeof(fm),"%d",PU);
pos = dini_Get(Pickups,fm);
if (strlen(pos)) {
split(pos,data,' ');
AddStaticPickup(1,strval(data[0]),floatstr(data[1]),floatstr(data[2]),floatstr(data[3]));
}
}
printf("Pickups Loaded!");
return asp;
}

Okay Now that  The Useless Files are gone lets make the Properties

use /s to get coords and add the first 3 coords [XYZ] in this format on on public OnGameModeInit()
AddStaticPickup(id,type,XYZ COORDS);
well  Its Done But Not Ready to Use
Goto Folder Scriptfiles >Properties>Names //Add The Name    Format: Idofthepickup)= Vice villa
Goto Folder Scriptfiles >Properties>Owners //Add The Owners"           " Format:(Idofthepickup)=Ben
Goto Folder Scriptfiles >Properties>Prices //Add The Price "            "Format:(Idofthepickup)=10001
Goto Folder Scriptfiles >Properties>Share//Add The Share "            "Format:Idofthepickup)=yazeen
 
If u dont have any one Owner or share Leave it in this format:
(Idofthepickup)=None
example 1=none

And Compile and Ready To use!!!
OMG my hand aches lol Hope it helps and if u have Doubt ask me in Yahoo



yazeen

  • Guest
Re: How to add properties and pickup's for them ?
« Reply #3 on: March 26, 2011, 11:05:23 am »
And Delete This Too

Code: [Select]
}
else if (strcmp(cmd, "!pheal", true) == 0) {
new Float:Health; GetPlayerHealth(playerid,Health); tmp = strtok(cmdtext, idx);
if (Health >= 100) SendClientMessage(playerid,COLOR_GREEN,"Error: You are healthy!");
else if(IsPropertyOwnedShared(strval(tmp),gPlayers[playerid]) == -1) SendClientMessage(playerid,COLOR_GREEN, "Error: You do not own that property!");
else {
    new as[4][128];
    split(dini_Get("/Pickups/Pickups.ini",tmp), as, ' ');

if(GetDistance(playerid,floatstr(as[1]),floatstr(as[2]),floatstr(as[3])) >= 15) {
SendClientMessage(playerid,COLOR_GREEN,"You have to be closer to your property!");
return 1;
}
new calc = (100 - 1);
    format(szMsg,sizeof(szMsg),"%d of your health has been restored.",calc);
SendClientMessage(playerid,COLOR_GREEN,szMsg);
SetPlayerHealth(playerid,100.0);
}
return 1;
}

Soory But u cant use !pdistance and !pheal Ask Pro Scripters to Help you in that

Offline Dawood136

  • Street Thug
  • *
  • Posts: 28
    • View Profile
Re: How to add properties and pickup's for them ?
« Reply #4 on: March 26, 2011, 11:22:32 am »
Thanks Alot, TOPIC LOCKED!
Signed,
Dawood Sahi
DSS RPG Owner/Leader