• Welcome to Vice City Multiplayer.
 
Menu

Show posts

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 Menu

Messages - Robd

#61
ShowRoom (pawn) / Re: Some RPG functions
February 27, 2011, 09:42:03 PM
lol, looks like i forgot a chunk of script
#62
mIRC/pawn Scripting / Re: Auto Event ??
February 26, 2011, 04:47:55 AM
Use timers
#63
mIRC/pawn Scripting / Re: [Pawn]Decrypt
February 26, 2011, 04:47:05 AM
I do my hosting via a friend of mine and some lines keep coming up missing, i want them to be encrypted so they cant be seen. I think i will try that though.
#64
ShowRoom (pawn) / Some RPG functions
February 26, 2011, 12:10:38 AM
This contains 2 RPG functions that are hard to come by.
  -Fuel system
  -Toggle Engine (yes there is a KillEngine in VCMP but it does not allow turning the engine back on, this does)

The first is relatively simple to insert, add the code somewhere near the bottom of the script and then use it as a function anywhere in the script.
public ToggleEngine(playerid,tmp)
{
new id;
id = GetPlayerVehicleID(playerid);
if(tmp == 0) {
KillVehicleEngine(id);
CarInfo[id][engineon] = 0;
}
else {
RemovePlayerFromVehicle(playerid);
PutPlayerInVehicle(playerid,id);
CarInfo[id][engineon] = 1;
}
return 1;
}


The next is a little more challenging as you have to add an array and several functions
This tutorial assumes you are using GUPS or GUPS based scripts
First:
We need to mae a new array(kinda like PlayerInfo, in GUPS)
Add this right under "enum sInfo"(where the definitions of variables end, not right below)
enum cInfo
{
gas
}

Then right below "new ServerInfo[1][sInfo];" put this
new CarInfo[here put the number of cars in your server][cInfo]
Now go to "OnGameModeInit"
put the following anywhere under LoadProps, or anything else in that area.
SetTimer("cargas",30000,true);
ok, now go somewhere near the bottom of your script(if you arent sure where just go to "stock HealAll"
public cargas()
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
if(PlayerInfo[i][onfoot] == 0) CarInfo[157][locked] = 1;
else {
            new id;
    id = GetPlayerVehicleID(i);
    new szMsg[256];
    CarInfo[id][gas] = CarInfo[id][gas] -1;
    format(szMsg,sizeof(szMsg),"~o~Fuel ~r~%d",CarInfo[id][gas]);
    GameTextForPlayerBottom(i,szMsg);
    if(CarInfo[id][gas] < 1) {
    KillVehicleEngine(id);
    CarInfo[id][gas] = 0;
}
}
}
}

Now we need to make cars without gas un-drivable.
Add the following in "OnPlayerEnterVehicle"
if(CarInfo[vehicleid][gas] < 1) {
ServerInfo[0][gas] = playerid;
SetTimer("engine",5000,false);
}

Now we just need to add the function in that timer
go to the same place you added "public cargas" and make a new function called "engine"
Make this code for the function
public engine()
{
new id;
SendClientMessage(ServerInfo[0][gas],COLOR_GREEN,"The engine dies, might want to check the fuel tank");
id = GetPlayerVehicleID(ServerInfo[0][gas]);
KillVehicleEngine(id);
ServerInfo[0][gas] = 100;
CarInfo[id][engineon] = 0;
return 1;
}

#65
ShowRoom (pawn) / Re: Location code for pawn
February 25, 2011, 11:27:27 PM
for getting location for a command to decide if a player is close enough to an object I just use GetPlayerDistance
#66
mIRC/pawn Scripting / Re: [Pawn]Decrypt
February 25, 2011, 11:26:26 PM
I want to encrypt some of the logs on my server so that I can keep them secure.
I want to be able to run a script (with the server) have it open up the INI and then decrypt it so I can read it
#67
ShowRoom (pawn) / Re: Some usefull functions
February 24, 2011, 12:38:54 AM
public log(text[256])
{
ServerInfo[0][line] = ServerInfo[0][line] +1;
new szMsg[256];
format(szMsg,sizeof(szMsg),"%d",ServerInfo[0][line]);
dini_Set("/chat.ini",szMsg,text);
}

and add this to OnGameModeInit
ServerInfo[0][line] = dini_Int("/chat.ini", "line");
This is good if you want to see what's happening in your server, make sure to add chat.ini in your script files folder
#68
mIRC/pawn Scripting / [Pawn]Decrypt
February 24, 2011, 12:25:33 AM
just wondering if anyone can make a decrypt for gups. I looked at the function and I'm just draving a
#69
try
OnPickedUp(pickupid,playerid)
{
    if(pickupid == 71) {
        SendClientMessage(playerid,COLOR_GREEN,"You drink a bear");
        SetPlayerDrunk(playerid,300,true);
    }
    return 1;
}
#70
ShowRoom (pawn) / Re: [GM]Blank Server
February 21, 2011, 09:50:01 PM
Quote from: yazeen on February 19, 2011, 02:05:18 PM
LOL WTF are u nuts??????????

uploading a new script


if u dont know about about this ill say it to u
* yazeen shouts: there is already a new script file with PAWNO
[/s]

sorry about what i said this script is good for noobs

not just blank script its ready to use'
* yazeen says : i take back what i said
I'm not so sure about his mental health   /me runs
#71
If you want to give each pickup an individual function....
first: Find the ID of the pickup you want (the first argument  on AddStaticPickup)
and then put
if (pickupid == <ID of pickup>
    SendClientMessage(playerid,COLOR_GREEN,"You found a cookie");
    return 1;
#72
ShowRoom (pawn) / Re: BLACK PANTHER v 5
February 20, 2011, 09:54:12 PM
A decent script, I wouldn't really say as far as Great or Bad...
#73
LC:MP / Re: Problem
February 20, 2011, 09:52:39 PM
Do you have any IPs for me?
#74
LC:MP / Problem
February 18, 2011, 02:53:23 AM
Whenever i go to the LC:MP tab it says like 57 players playing on 0 servers
and it gives me no servers
I have the mod installed and i defined my directory
#75
ShowRoom (pawn) / Re: Some usefull functions
February 18, 2011, 02:32:56 AM
lol ya, thats an array i forgot to include
here ya go.
public WantedBar(Float:data)
{
new x[256];
if (data == 0) x = "~b~>>>>>>";
else if (data == 1) x = "~b~>>>>>~w~>";
else if (data == 2) x = "~b~>>>>~w~>>";
else if (data == 3) x = "~b~>>>~w~>>>";
else if (data == 4) x = "~b~>>~w~>>>>";
else if (data == 5) x = "~b~>~w~>>>>>";
else if (data == 6) x = "~w~>>>>>>";
return x;
}