Quick question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Quick question (
/showthread.php?tid=204195)
Quick question -
Anthonyx3' - 29.12.2010
How do you save stuff when a player crashes, and how do you see if a person crashed to save stuff?
And so i dont have to make another thread later, how do i make a like global engine using 0.3c functions? When one player starts the engine, then another person trys driving, its off. And when you get into another car, you gotta do engine twice to make it work, how would i set engines per vehicle, if anyone understands shit i just said
Re: Quick question -
_rAped - 29.12.2010
This explains pretty much everything you need to know about crashes.
OnPlayerDisconnect()
For the engine take a look at:
SetVehicleParamsEx()
Just remember to define
ManualVehicleEngineAndLights() first.
Re: Quick question -
Anthonyx3' - 29.12.2010
I know how to make the basic engine, the wiki doesnt answer my question thought, ill try some things with onplayerdisconnect
Re: Quick question -
Marricio - 29.12.2010
if you arent saving stuff
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new string[64], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
}
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
else
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new
string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: // crashed
}
// save stuff here and etc.
{
case 1: // disconnected
}
// stuff here
{
case 2: // kicked or banned
}
// stuff
{
SendClientMessageToAll(0xFFFFFFAA,string);
}
}
return 1;
}
that's basic (quote if any error)
Re: Quick question -
Anthonyx3' - 29.12.2010
Alright, cause when a player crashes, he is spawned to that annoying 0.0 place with no skin, cj. I will try doing this
Re: Quick question -
Anthonyx3' - 29.12.2010
Hmm, error, I never understand the switch cases.
pawn Код:
(870 -- 890) : error 010: invalid function or declaration
Lines,
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new
string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: // crashed
{
// save stuff here and etc.
}
case 1: // disconnected
{
// stuff here
}
case 2: // kicked or banned
{
// stuff
}
}
}
return 1;
}
Re: Quick question -
Mean - 29.12.2010
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new
string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: // crashed
{
// save stuff here and etc.
}
case 1: // disconnected
{
// stuff here
}
case 2: // kicked or banned
{
// stuff
}
}
return 1;
}
You had an unneeded bracket.