A few quiestions -
yaron0600 - 20.03.2013
A few quiestions I read alot of tutrials but Didnt understand still what is
public OnPlayerConnect(playerid)
public OnPlayerDisconnect(playerid, reason)
public OnPlayerSpawn(playerid)
public OnPlayerDeath(playerid, killerid, reason)
public OnVehicleSpawn(vehicleid)
public OnVehicleDeath(vehicleid, killerid)
public OnPlayerText(playerid, text[])
What is each thing from here in script ? And where can I use it in FS or script or both ?
Re: A few quiestions -
shady001 - 20.03.2013
1. You can use in both (FS and GM)
2.
pawn Код:
public OnPlayerConnect(playerid)
//this code will be executed when player connects to server
public OnPlayerDisconnect(playerid, reason)
//this code will be executed when player disconnects from server
public OnPlayerSpawn(playerid)
//this code will be executed when player respawn
public OnPlayerDeath(playerid, killerid, reason)
//this code will be executed when player dies
public OnVehicleSpawn(vehicleid)
//this code will be executed when vehicle spawn
public OnVehicleDeath(vehicleid, killerid)
//this code will be executed when vehicle "dies"
public OnPlayerText(playerid, text[])
//this code will be executed when player time some text in "T" (the text should not begin with "/" if it begins whit "/" is executed : OnPlayerCommandText
In most cases the name says what it is doing ...
Re: A few quiestions -
yaron0600 - 20.03.2013
So can u tell me also whats this ?
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
Re: A few quiestions -
shady001 - 20.03.2013
https://sampwiki.blast.hk/wiki/Category:Scripting_Callbacks
Re: A few quiestions -
freddy smyth - 20.03.2013
They are pretty much callback functions.
Example: OnGameModeInit means when the GM starts up. What you script in there will occur when the GM starts. I'd start with OnPlayerConnect and OnPlayerSpawn to begin if I were you. That can be quite simple. Think to yourself: What do you want to happen when the player connects or spawns. Then script it in. I hope this approach makes this easier for you.
I encourage you to read the SAMP Wiki, the basics at least!
You're a long way off, but you can improve if you try!