Author Topic: Non-Damagable cars  (Read 5018 times)

0 Members and 1 Guest are viewing this topic.

Offline NE.Restricted

  • Wiseguy
  • **
  • Posts: 97
    • View Profile
Non-Damagable cars
« on: September 20, 2013, 04:25:57 pm »
On top:
[pawn]new autofix[101];
new vehid[101];[/pawn]
On OnGameModeInit:
[pawn]public OnGameModeInit(){
SetTimer("autofixtimer", 500, 1);//this is the line you need to add
}[/pawn]
On OnPlayerText:
Code: [Select]
public OnPlayerText(playerid, cmdtext[])
{
if(strfind(cmdtext, "!", true) == 0) OnPlayerCommand(playerid, cmdtext[1]);//this is to prevent confusion between different scripts.
}
Add public OnPlayerCommand:
Code: [Select]
public OnPlayerCommand(playerid, command[])
{
new idx, cmd[243];
new tmp[243], tmp2[243];//we put array to be able to use strcmp on it
cmd = strtok(command, idx);
tmp = strtok(command, idx);//we use this here so we dont always need to define tmp
tmp2 = strtok(command, idx);
if(strcmp(command, "autofix", true) == 0){
if(autofix[playerid] == 0)
{
autofix[playerid] = 1;
SendClientMessage(playerid, 0x0FFDD349, "Autofix set to: [ON]");
}
if(autofix[playerid] == 1)
{
autofix[playerid] = 0;
SendClientMessage(playerid, 0x0FFDD349, "Autofix set to: [OFF]");
}
}
}
Add public autofixtimer
[pawn]public autofixtimer()
{
for(new mpl; mpl <= 100; mpl++) if(IsPlayerConnected(mpl) && autofix[mpl] == 1 && vehid[mpl] != 700){
SetVehicleHealth(vehid[mpl], 1000);
//printf("Auto-fixed player vehicle: [%d]", mpl);//uncomment if you want to be notified on every autofix
}
}[/pawn]
On OnPlayerEnterVehicle:
[pawn]public OnPlayerEnterVehicle(playerid, vehicleid)//yours may have parameter ispassenger
{
vehid[playerid] = vehicleid;
}[/pawn]
On OnPlayerExitVehicle:
[pawn]public OnPlayerExitVehicle(playerid)//yours may have additional parameters
{
vehid[playerid] = 700;
}[/pawn]

If you find any bugs, report them now!
Also, dont forget to rate!

NOTE: To add more commands to OnPlayerCommand, DO NOT use ! before text for example you use !say it will be activated when player types !!say and not !say.
« Last Edit: September 21, 2013, 09:56:37 am by NE.Restricted »
I am NE.CrystalBlue!!!
Quote
i cant able to understand

Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
Re: Non-Damagable cars
« Reply #1 on: September 20, 2013, 04:49:30 pm »
Nice Job  ;)

Offline NE.Restricted

  • Wiseguy
  • **
  • Posts: 97
    • View Profile
Re: Non-Damagable cars
« Reply #2 on: September 21, 2013, 09:50:25 am »
Nice Job  ;)
Hmm nice job? I could make even professional systems than this
I am NE.CrystalBlue!!!
Quote
i cant able to understand

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Non-Damagable cars
« Reply #3 on: September 22, 2013, 02:21:35 pm »
Nice Job  ;)
Hmm nice job? I could make even professional systems than this

lol... he is polite. :-X
And what stops you to make better system ?

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline NE.Restricted

  • Wiseguy
  • **
  • Posts: 97
    • View Profile
Re: Non-Damagable cars
« Reply #4 on: September 22, 2013, 02:28:47 pm »
Nice Job  ;)
Hmm nice job? I could make even professional systems than this

lol... he is polite. :-X
And what stops you to make better system ?
I know he is polite. Just telling him that this is not the best I can make.
I am NE.CrystalBlue!!!
Quote
i cant able to understand

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: Non-Damagable cars
« Reply #5 on: September 22, 2013, 08:58:27 pm »
Nice Job  ;)
Hmm nice job? I could make even professional systems than this

lol... he is polite. :-X
And what stops you to make better system ?
I know he is polite. Just telling him that this is not the best I can make.

Okay... but this isn't something you made. Can you please be more constructive with your criticism?
Do not PM me for support.




Offline NE.Restricted

  • Wiseguy
  • **
  • Posts: 97
    • View Profile
Re: Non-Damagable cars
« Reply #6 on: September 23, 2013, 02:47:28 pm »
Nice Job  ;)
Hmm nice job? I could make even professional systems than this

lol... he is polite. :-X
And what stops you to make better system ?
I know he is polite. Just telling him that this is not the best I can make.

Okay... but this isn't something you made. Can you please be more constructive with your criticism?
What you mean? That I copied it? If so, no i didn't copied it.
I am NE.CrystalBlue!!!
Quote
i cant able to understand