Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: =RK=MarineForce on May 13, 2018, 08:07 PM

Title: Needed a Important Help
Post by: =RK=MarineForce on May 13, 2018, 08:07 PM
Hello, Guyz i need a help.

can u give me Diepos on system i mean,

when Players die. if he spawn player pos = where he die.

and with cmd
else if ( cmd == "diepos" )
{
if(!text) MessagePlayer(" /diepos on and off ", player);
case"on"
{
}
calse"off"
{
}
}
 can u give me this?
don't understand i think sorry.

and irc system
Title: Re: Needed a Important Help
Post by: umar4911 on May 14, 2018, 12:46 AM
Okay I am going to help you by not giving you the code, just giving hint and you will makw yourself.
There will be 2 class like diepos = false; and dieposloc = null;

If player uses the cmd /diepos and the arguments are true, it will set the diepos class to true.
Okay, as soon as a player is killed or dies, its location where he died will be set into dieposloc.

As soon as play spawn, it checks that if the class diepos = true and dieposloc!= null then set the pos of player that in dieposloc
Title: Re: Needed a Important Help
Post by: =RK=MarineForce on May 14, 2018, 01:11 PM
Only i need This

else if ( cmd =="diepos on")
{
diepos = true;
}
else if ( cmd == "diepos off" )
{
diepos = false;
}

plz give me the code i don't know more about it
else{
i
Title: Re: Needed a Important Help
Post by: =RK=MarineForce on May 14, 2018, 01:12 PM
i don't learn about this in wiki can u give me how to learn this to make it by ownself! plz help Thank For Support!s
Title: Re: Needed a Important Help
Post by: Mohamed Boubekri on May 14, 2018, 01:26 PM
Uhh! i Also have the command. @umar4911 try to use stats[player.ID].Diepos Better than diepos = on.
Because diepos = on, that will enable diepos of all players, but stats[player.ID].Diepos = true, that will enabel diepos for player.
@=RK=MarineForce, Just Create a Class, You can check examples on an account system,
Then create cmd /diepos, you can save diepos of player by stats[player.ID].X = player.Pos.x.............
But make it on function onplayerdeath, then add on onplayerspawn to teleport player to the die pos. which it's saved already on function onplayerdeath.
Title: Re: Needed a Important Help
Post by: umar4911 on May 14, 2018, 04:33 PM
Quote from: Mohamed on May 14, 2018, 01:26 PMUhh! i Also have the command. @umar4911 try to use stats[player.ID].Diepos Better than diepos = on.
Because diepos = on, that will enable diepos of all players, but stats[player.ID].Diepos = true, that will enabel diepos for player.
@=RK=MarineForce, Just Create a Class, You can check examples on an account system,
Then create cmd /diepos, you can save diepos of player by stats[player.ID].X = player.Pos.x.............
But make it on function onplayerdeath, then add on onplayerspawn to teleport player to the die pos. which it's saved already on function onplayerdeath.
I mentioned "make 2 classes"
Title: Re: Needed a Important Help
Post by: umar4911 on May 14, 2018, 11:49 PM
Quote from: vitogta on May 14, 2018, 05:26 PMan array is not a class.
yeah I know. A class will look lile stats[player.ID].diepos
Title: Re: Needed a Important Help
Post by: =RK=MarineForce on May 15, 2018, 06:55 AM
I m trying Thanks For Support Gud~
Title: Re: Needed a Important Help
Post by: =RK=MarineForce on May 15, 2018, 06:59 AM
Its Hard Plese, Give me The code i will get some more helps from him

Brothers can u help me how to make Database and functions Commands and load script from database

since i m member of 2013 i don't know each other :'(
Title: Re: Needed a Important Help
Post by: umar4911 on May 15, 2018, 02:28 PM
Quote from: =RK=MarineForce on May 15, 2018, 06:59 AMIts Hard Plese, Give me The code i will get some more helps from him

Brothers can u help me how to make Database and functions Commands and load script from database

since i m member of 2013 i don't know each other :'(
I became a vcmp scripter in 2017.

Okay post the code uptil now you made.
Title: Re: Needed a Important Help
Post by: =RK=MarineForce on May 15, 2018, 02:58 PM
If You Don't Want to help so go away from this topic! I don't want Your Help You are not biggest scripter of VC-MP There are more best scripters are help me more than u Go away from this topic if u want to not help if u want to help so what i m giving Request if u can't give me it so go away from this topic there are more best scripters man ARE THERE @Tornado,Mohammed,SaiyanAttack,Zeus,Anik,.,vitogta They are best than u if u want to help so give here what i want plese!
Title: Re: Needed a Important Help
Post by: Retard on May 15, 2018, 04:42 PM
This is not tested there may be mistakes
class diepos
{
diepos = false;
x = 0;
y = 0;
z = 0;
}
function onPlayerJoin( player )
{
dp[ player.ID ] = diepos( );
}
function onPlayerDeath( player, reason )
{
dp[ player.ID ].x; = player.Pos.x
dp[ player.ID ].y; = player.Pos.y
dp[ player.ID ].z; = player.Pos.z
}
function onPlayerSpawn( player )
{
if( dp[ player.ID ].diepos = true ) {
player.Pos.x = dp[ player.ID ].x;
player.Pos.y = dp[ player.ID ].y;
player.Pos.z = dp[ player.ID ].z; }
}
Title: Re: Needed a Important Help
Post by: Mahmoud Tornado on May 15, 2018, 05:00 PM
Quote from: =RK=MarineForce on May 15, 2018, 02:58 PMIf You Don't Want to help so go away from this topic! I don't want Your Help You are not biggest scripter of VC-MP There are more best scripters are help me more than u Go away from this topic if u want to not help if u want to help so what i m giving Request if u can't give me it so go away from this topic there are more best scripters man ARE THERE @Tornado,Mohammed,SaiyanAttack,Zeus,Anik,.,vitogta They are best than u if u want to help so give here what i want plese!
Why you angry now? He is right, you must learn you will never make your server with the others help, Just Try!!!,
Quote from: =RK=MarineForce on May 15, 2018, 06:55 AMI m trying Thanks For Support Gud~
You was right that you said you will try, but did you tried? Ha, Did you?
Bro just try, I'm Become Scripter from 2018, i was just beginner in 2017.
But it didn't Matter when you started it's with you want to be or not.
Scripting don't want an English grammar to make, it want to just thinking what you will do and how?
English grammars only in Massages! :V
Quote from: Ali Ahmed on May 15, 2018, 04:42 PMThis is not tested there may be mistakes
class diepos
{
diepos = false;
x = 0;
y = 0;
z = 0;
}
function onPlayerJoin( player )
{
dp[ player.ID ] = diepos( );
}
function onPlayerDeath( player, reason )
{
dp[ player.ID ].x; = player.Pos.x
dp[ player.ID ].y; = player.Pos.y
dp[ player.ID ].z; = player.Pos.z
}
function onPlayerSpawn( player )
{
if( dp[ player.ID ].diepos = true ) {
player.Pos.x = dp[ player.ID ].x;
player.Pos.y = dp[ player.ID ].y;
player.Pos.z = dp[ player.ID ].z; }
}
Here is your want, from Ali Ahmed.
Do you think this is very hard as you said?
Quote from: =RK=MarineForce on May 15, 2018, 06:59 AMIts Hard Plese, Give me The code i will get some more helps from him
Just try to understand it, not only copy and paste.
Title: Re: Needed a Important Help
Post by: Retard on May 15, 2018, 05:44 PM
I know it's easy but the way umar was ignoring him and the message he sent made me emotional so i made it and posted it
Title: Re: Needed a Important Help
Post by: Mohamed Boubekri on May 15, 2018, 06:53 PM
Quote from: Ali Ahmed on May 15, 2018, 04:42 PMThis is not tested there may be mistakes
class diepos
{
diepos = false;
x = 0;
y = 0;
z = 0;
}
function onPlayerJoin( player )
{
dp[ player.ID ] = diepos( );
}
function onPlayerDeath( player, reason )
{
dp[ player.ID ].x; = player.Pos.x
dp[ player.ID ].y; = player.Pos.y
dp[ player.ID ].z; = player.Pos.z
}
function onPlayerSpawn( player )
{
if( dp[ player.ID ].diepos = true ) {
player.Pos.x = dp[ player.ID ].x;
player.Pos.y = dp[ player.ID ].y;
player.Pos.z = dp[ player.ID ].z; }
}
Maybe you need to add the line in function onscriptload:-( Because you need definition of dp. )
dp <- array( GetMaxPlayers(), null );And Also change the function onplayerspawn from:-
function onPlayerSpawn( player )
{
if( dp[ player.ID ].diepos = true ) {
player.Pos.x = dp[ player.ID ].x;
player.Pos.y = dp[ player.ID ].y;
player.Pos.z = dp[ player.ID ].z; }
}
To:-
function onPlayerSpawn( player )
{
if( dp[ player.ID ].diepos == true ) {
player.Pos.x = dp[ player.ID ].x;
player.Pos.y = dp[ player.ID ].y;
player.Pos.z = dp[ player.ID ].z; }
}
And Also Change Function onplayerdeath From:-
function onPlayerDeath( player, reason )
{
dp[ player.ID ].x; = player.Pos.x
dp[ player.ID ].y; = player.Pos.y
dp[ player.ID ].z; = player.Pos.z
}
To:-
function onPlayerDeath( player, reason )
{
dp[ player.ID ].x = player.Pos.x;
dp[ player.ID ].y = player.Pos.y;
dp[ player.ID ].z = player.Pos.z;
}
Anyway, Nice you got my idea!
Title: Re: Needed a Important Help
Post by: =RK=MarineForce on May 15, 2018, 07:21 PM
Thanks Man You're Best Humans
Title: Re: Needed a Important Help
Post by: =RK=MarineForce on May 15, 2018, 07:27 PM
I didn't undertstand from This

how do server know dp?


I didn't Understand Mohamed how Server know ? what is Dp?
and some commands

Untested cmds
else if ( cmd == "diepos on " )
{
if( dp[ player.ID ].diepos == true ) MessagePlayer(" Your Diepos is already On ", player);
else{
dp[ player.ID ].diepos == true;
}
}
else if ( cmd == "diepos off " )
{
if( dp[ player.ID ].diepos == false ) MessagePlayer(" Your Diepos is already off ", player);
dp[ player.ID ].diepos == false;
}

else if ( cmd == "diepos" )
{
MessagePlayer(" [#0000FF] Error- [#00FFFF] /" + cmd + " on and off ", player);
}

and 1 thing

player.Pos.x.y.z = dp[ player.ID ].x.y.z;
Title: Re: Needed a Important Help
Post by: =RK=MarineForce on May 15, 2018, 07:43 PM
Didn't working :/


class diepos
{
diepos = false;
x = 0;
y = 0;
z = 0;
}

function onScriptLoad()
{
dp <- array( GetMaxPlayers(), null );
}

function onPlayerJoin( player )
{
dp[ player.ID ] = diepos( );
}

function onPlayerSpawn(player)
{
if( dp[ player.ID ].diepos = true ) {
player.Pos.x = dp[ player.ID ].x;
player.Pos.y = dp[ player.ID ].y;
player.Pos.z = dp[ player.ID ].z;
}

function onPlayerDeath( player, reason )
{
if( dp[ player.ID ].diepos = true ) {
player.Pos.x = dp[ player.ID ].x;
player.Pos.y = dp[ player.ID ].y;
player.Pos.z = dp[ player.ID ].z;
}

and i have more functions spawnloc set spawnwep in added didn't working for  showing any error line 259 in onplayerdeath

when i type /kill and spawn its say You are spawnwed at your location its spawnloc cmd . but diepos no works
i added
Title: Re: Needed a Important Help
Post by: Mohamed Boubekri on May 15, 2018, 10:35 PM
The system it's have many errors, Tomorrow i'll Create one diepos system for you.
Title: Re: Needed a Important Help
Post by: Saiyan Attack on May 15, 2018, 10:38 PM
GetTok is required ... you have to paste them correctly and then it works as you want
// add this on top of your main.nut or anywhere ...
Death <- {
Position = array(100,null),
Stats = array(100,false),

function Spawn(player)
{
if(this.Stats[player.ID] == true) {
local coord = ::split(this.Position[player.ID],", ");
local axisX = coord[0], axisY = [1], axisZ = [2];
player.Pos = ::Vector(axisX.toflaot(), axisY.tofloat(), axisZ.tofloat());
::PrivMessage(player,"Spawn to your last diepos");
}
}

function Save(player)
{
if(this.Stats[player.ID] == true ) {
this.Position[player.ID] = player.Pos.x+", "+player.Pos.y+", "+player.Pos.z;
}
}

function Add(player)
{
this.Stats[player.ID] = true;
::PrivMessage(player,"Diepos enable to your account!");
}

function Remove(player)
{
if(this.Stats[player.ID] == true ) {
this.Position[player.ID] = null;
this.Stats[player.ID] = false;
}
}
};
onPlayerSpawn
// add this line after your code ....
Death.Spawn(player);

onPlayerPart
Death.Remove(player);
onPlayerDeath and onPlayerKill
Death.Save(player);
onPlayerCommand
if(cmd.tolower() == "diepos")
{
if(!text) MessagePlayer("Correct Syntax: /"+cmd+" [On/Off]",player);
else {
local state = GetTok(text," ",1);
switch(state.tolower()) {
case "on":
if(Death.Stats[player.ID] == true) MessagePlayer("you're already enable diepos in your account!",player);
else Death.Add(player);
break;
case "off":
if(Death.Stats[player.ID] == false) MessagePlayer("you're already disable diepos in your account!",player);
else {
Death.Remove(player);
PrivMessage(player,"Diepos disable to your account!");
}
break;
default: MessagePlayer("Correct Syntax: /"+cmd+" [On/Off]",player); break;
}
}
}
Title: Re: Needed a Important Help
Post by: umar4911 on May 16, 2018, 12:25 AM
Quote from: Mahmoud Tornado on May 15, 2018, 05:00 PM
Quote from: =RK=MarineForce on May 15, 2018, 02:58 PMIf You Don't Want to help so go away from this topic! I don't want Your Help You are not biggest scripter of VC-MP There are more best scripters are help me more than u Go away from this topic if u want to not help if u want to help so what i m giving Request if u can't give me it so go away from this topic there are more best scripters man ARE THERE @Tornado,Mohammed,SaiyanAttack,Zeus,Anik,.,vitogta They are best than u if u want to help so give here what i want plese!
Why you angry now? He is right, you must learn you will never make your server with the others help, Just Try!!!,
Quote from: =RK=MarineForce on May 15, 2018, 06:55 AMI m trying Thanks For Support Gud~
You was right that you said you will try, but did you tried? Ha, Did you?
Bro just try, I'm Become Scripter from 2018, i was just beginner in 2017.
But it didn't Matter when you started it's with you want to be or not.
Scripting don't want an English grammar to make, it want to just thinking what you will do and how?
English grammars only in Massages! :V
Quote from: Ali Ahmed on May 15, 2018, 04:42 PMThis is not tested there may be mistakes
class diepos
{
diepos = false;
x = 0;
y = 0;
z = 0;
}
function onPlayerJoin( player )
{
dp[ player.ID ] = diepos( );
}
function onPlayerDeath( player, reason )
{
dp[ player.ID ].x; = player.Pos.x
dp[ player.ID ].y; = player.Pos.y
dp[ player.ID ].z; = player.Pos.z
}
function onPlayerSpawn( player )
{
if( dp[ player.ID ].diepos = true ) {
player.Pos.x = dp[ player.ID ].x;
player.Pos.y = dp[ player.ID ].y;
player.Pos.z = dp[ player.ID ].z; }
}
Here is your want, from Ali Ahmed.
Do you think this is very hard as you said?
Quote from: =RK=MarineForce on May 15, 2018, 06:59 AMIts Hard Plese, Give me The code i will get some more helps from him
Just try to understand it, not only copy and paste.
Now I am outta his topic. No more help for marine ever.

Quote from: Ali Ahmed on May 15, 2018, 05:44 PMI know it's easy but the way umar was ignoring him and the message he sent made me emotional so i made it and posted it
I wanted him to not to copy the code but to use his effort to make a code if that is even wrong, I will fix that but I dont think he is interested in learning squirrel.

Good Luck for future marine.
Title: Re: Needed a Important Help
Post by: Retard on May 16, 2018, 07:52 AM
Ok, I'm going t answer sincerely. I was bored so i made that shit. That is the Answer to all of youur questions and marine please lock the damn topic and try something yourself
Title: Re: Needed a Important Help
Post by: Xmair on May 16, 2018, 01:49 PM
diePos <- array( GetMaxPlayers( ), false );

class CDie <- {
enabled = false;
pos = null;
}

function onPlayerJoin( player ) {
diePos[ player.ID ] = CDie( );
}

function onPlayerSpawn( player ) {
if ( diePos[ player.ID ].enabled == true && diePos[ player.ID ].pos != null ) {
player.Pos = diePos[ player.ID ].pos;
}
}

function onPlayerDeath( player, reason ) {
if ( diePos[ player.ID ].enabled == true ) {
diePos[ player.ID ].pos = player.Pos;
}
}

function onPlayerKill( killer, player, reason, bodypart ) {
if ( diePos[ player.ID ].enabled == true ) {
diePos[ player.ID ].pos = player.Pos;
}
}

function onPlayerTeamKill( killer, player, reason, bodypart ) {
if ( diePos[ player.ID ].enabled == true ) {
diePos[ player.ID ].pos = player.Pos;
}
}

function onPlayerCommand( player, cmd, text ) {
if ( cmd.tolower( ) == "diepos" ) {
switch( diePos[ player.ID ].enabled ) {
case true:
diePos[ player.ID ].enabled = false;
MessagePlayer( "[#0099CC]You'll no longer spawn where you died.", player );
break;

case false:
diePos[ player.ID ].enabled = true;
MessagePlayer( "[#0099CC]You'll now spawn where you died.", player );
break;

default:
diePos[ player.ID ].enabled = true;
MessagePlayer( "[#0099CC]You'll now spawn where you died.", player );
break;
}
}
}
Untested.
Title: Re: Needed a Important Help
Post by: Mohamed Boubekri on May 16, 2018, 02:29 PM
Tested.
class Diepos
{
 Diepos = false;
 X = 0;
 Y = 0;
 Z = 0;
}
function onScriptLoad()
{
dstats <- array( GetMaxPlayers(), null );
}
function onPlayerJoin( player )
{
dstats[ player.ID ] = Diepos();
}
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "credits" )
{
MessagePlayer("[#00ffff]Information: [#ffffff]Diepos System By We3da^",player);
}
else if ( cmd == "diepos" )
{
if ( !player.IsSpawned ) MessagePlayer( "[#ff0000]Error: You Must Spawn First.", player );
else if ( player.Vehicle ) MessagePlayer( "[#ff0000]Information: [#ffffff]You Can't Teleport You Need To Exit That's Cars.", player );
else if (  !text ) MessagePlayer("[#00ffff]Syntax: [#ffffff]/diepos <on/off>",player);
else if ( text == "on" ) MessagePlayer("[#00ffff]Information: [#ffffff]Die Pos Enabled",player), dstats[ player.ID ].Diepos = true;
else if ( text == "off" ) MessagePlayer("[#00ffff]Information: [#ffffff]Die Pos Disabled",player),  dstats[ player.ID ].Diepos = false;
else MessagePlayer("[#00ffff]Syntax: [#ffffff]/diepos <on/off>",player);
}
}
function onPlayerSpawn( player )
{
if ( dstats[ player.ID ].Diepos )
{
player.Pos = Vector( dstats[ player.ID ].X, dstats[ player.ID ].Y, dstats[ player.ID ].Z );
}
}
function onPlayerDeath( player, reason )
{
if ( dstats[ player.ID ].Diepos == true )
{
dstats[ player.ID ].X = player.Pos.x.tofloat();
dstats[ player.ID ].Y = player.Pos.y.tofloat();
dstats[ player.ID ].Z = player.Pos.z.tofloat();
}
}
function onPlayerKill( killer, player, reason, bodypart )
{
if ( dstats[ player.ID ].Diepos == true )
{
dstats[ player.ID ].X = player.Pos.x.tofloat();
dstats[ player.ID ].Y = player.Pos.y.tofloat();
dstats[ player.ID ].Z = player.Pos.z.tofloat();
}
}
Title: Re: Needed a Important Help
Post by: NicusorN5 on May 16, 2018, 06:27 PM
Quote from: =RK=MarineForce on May 15, 2018, 02:58 PMARE THERE @Tornado,Mohammed,SaiyanAttack,Zeus,Anik,.,vitogta They are best than u if u want to help so give here what i want plese!
L M A O . Nice grammar dude.