• Welcome to Vice City Multiplayer.
 

How to add properties and pickup's for them ?

Started by Dawood136, March 25, 2011, 06:54:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dawood136

How to add properties and pickup's for them ? can any one telllllllllllllll  meeeeeeeeeeeeeeeeeeeee
Signed,
Dawood Sahi
DSS RPG Owner/Leader

Skirmant

#1
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?

I know advance mIRC, average C++, basic Pawn & Squirrel, very basic Java Script.

yazeen

Ok Dawood Your Using So here you go
Delete These Lines:

#define Pickups             "/Pickups/Pickups.ini"

}
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;
}


}
    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;
    }


LoadPickups();

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;
}



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

And Delete This Too

}
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

Dawood136

Signed,
Dawood Sahi
DSS RPG Owner/Leader