Simple basic tutorial with name & vehicleid -
DarkClone - 23.07.2010
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
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
return 1;
}
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:
pawn Code:
if(GetVehicleModel(vehicleid) == 468){
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:
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
if(GetVehicleModel(vehicleid) == 468){
SetVehicleHealth(vehicleid, 50000);
return 1;
}
Hope this helps with whatever you need like this...
Now, for OnPlayerSpawn with playernames.
Make sure you have the
pawn Code:
public OnPlayerSpawn(playerid)
{
return 1;
}
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:
pawn Code:
if(name == DarkClone || OtherDude){
Remember to define OtherDude!
So we got it now, Now let's do something!
pawn Code:
SetPlayerHealth(playerid, 1);
Okay now their health is 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;
}
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.
Re: Simple basic tutorial with name & vehicleid -
Яσскѕтая - 23.07.2010
Pretty good for your first
Re: Simple basic tutorial with name & vehicleid -
DarkClone - 23.07.2010
Quote:
Originally Posted by Яσскѕтая
Pretty good for your first 
|
Thanks rockstar!
Re: Simple basic tutorial with name & vehicleid -
TheKingOfSamp - 23.07.2010
Good tutorial , basic things
Re: Simple basic tutorial with name & vehicleid -
Davz*|*Criss - 19.03.2011
Nice
Re: Simple basic tutorial with name & vehicleid -
StreetGT - 19.03.2011
are you sure that works?
Re: Simple basic tutorial with name & vehicleid -
alpha500delta - 19.03.2011
Quote:
Originally Posted by Davz*|*Criss
Nice
|
Do you ALWAYS have to bump old topics only to say "nice"?
Re: Simple basic tutorial with name & vehicleid -
StreetGT - 19.03.2011
it's never will work freak, you forget something with GetPlayerName -.-'
Re: Simple basic tutorial with name & vehicleid -
dice7 - 19.03.2011
Maybe you should learn the basics first
Re: Simple basic tutorial with name & vehicleid -
marinov - 19.03.2011
you forgot to GetPlayerName and see if it is the same as the defined name