23.07.2010, 04:18
(
Last edited by DarkClone; 23/07/2010 at 07:53 AM.
)
Very simple/basic tutorial with names, and vehicleid!
This is my first tutorial, I'm bad with them i guess, Sorry if i mess
ed something up, Tell me what i did wrong, and comment and stuff, Thank you!
Hello there, I'm going to show you, when a player enters a vehicle, if the vehicle is
let's say, a sanchez, It will set the vehicles health to 50000
First, make sure you have the
in your gamemode/filterscript., If not add it, Now head to it..
First we need to check if the vehicle's id is 468 (Aka sanchez), So:
So we've got the vehicleid, Now we have to do something,
[/pawn]SetVehicleHealth(vehicleid, 50000);[/code]
So now if you've done that, It should end up some what like this:
Hope this helps with whatever you need like this...
Now, for OnPlayerSpawn with playernames.
Make sure you have the
In your gamemode/filterscript.
First, we need to add the define for the name, and the playersname,
Example:
Now we need to get the name when they spawn.
(But, for muti stuff like DarkClone and OtherDude, Use this:
Remember to define OtherDude!
So we got it now, Now let's do something!
Okay now their health is 1.
Your code should end up like this:
I believe you could do something like that with OnPlayerConnect too. Also i'm not sure if it works.
Remember, this is my first tutorial, And please don't say it sucks.
This is my first tutorial, I'm bad with them i guess, Sorry if i mess
ed something up, Tell me what i did wrong, and comment and stuff, Thank you!
Hello there, I'm going to show you, when a player enters a vehicle, if the vehicle is
let's say, a sanchez, It will set the vehicles health to 50000
First, make sure you have the
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
return 1;
}
First we need to check if the vehicle's id is 468 (Aka sanchez), So:
pawn Code:
if(GetVehicleModel(vehicleid) == 468){
[/pawn]SetVehicleHealth(vehicleid, 50000);[/code]
So now if you've done that, It should end up some what like this:
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
if(GetVehicleModel(vehicleid) == 468){
SetVehicleHealth(vehicleid, 50000);
return 1;
}
Now, for OnPlayerSpawn with playernames.
Make sure you have the
pawn Code:
public OnPlayerSpawn(playerid)
{
return 1;
}
First, we need to add the define for the name, and the playersname,
Example:
pawn Code:
new name, DarkClone;
pawn Code:
if(name == DarkClone){
pawn Code:
if(name == DarkClone || OtherDude){
So we got it now, Now let's do something!
pawn Code:
SetPlayerHealth(playerid, 1);
Your code should end up like this:
pawn Code:
public OnPlayerSpawn(playerid)
{
new name, DarkClone;
if(name == DarkClone){
SetPlayerHealth(playerid, 1);
return 1;
}
return 1;
}
Remember, this is my first tutorial, And please don't say it sucks.