how can i - 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: how can i (
/showthread.php?tid=202147)
how can i -
StyleR - 23.12.2010
guys i wanna to do some like when someone enter in a sales vehicle to get him in that car and freeze him i try this and i dont know how to do
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
new vehicle[24];
GetVehicleName(vehicleid, vehicle, sizeof(vehicle));
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Spectate[i] != 255)
{
PlayerSpectateVehicle(i,vehicleid);
}
}
}
if(IsAnOwnableCar(vehicleid))
{
format(string,sizeof(string),"You are entering to a %s (%d) Owner: %s",vehicle, vehicleid, CarInfo[vehicleid][cOwner]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(IsASalesVehicle(vehicleid))
{
format(string,sizeof(string),"You are entering to a %s (%d) Owner: Dealership",vehicle, vehicleid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
TogglePlayerControllable(playerid, 0);
PutPlayerInVehicle(playerid, 0);
Re: how can i - rjjj - 23.12.2010
I think that this will solve your problem:
Put:
pawn Код:
//In The End of you GameMode:
stock FreezePlayer(playerid)
{
TogglePlayerControllable(playerid, false);
TogglePlayerControllable(playerid, true);
TogglePlayerControllable(playerid, false);
return 1;
}
//And, in your OnPlayerEnterVehicle callback, put:
if(IsASalesVehicle(vehicleid))
{
format(string,sizeof(string),"You are entering to a %s (%d) Owner: Dealership",vehicle, vehicleid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
FreezePlayer(playerid); //Will Freeze the player
//PutPlayerInVehicle(playerid, 0);
}
I hope that i have helped
Re: how can i -
DragonBlaster50 - 23.12.2010
Quote:
Originally Posted by rjjj
I think that this will solve your problem:
Put:
pawn Код:
//In The End of you GameMode:
stock FreezePlayer(playerid) { TogglePlayerControllable(playerid, false); TogglePlayerControllable(playerid, true); TogglePlayerControllable(playerid, false); return 1; }
//And, in your OnPlayerEnterVehicle callback, put:
if(IsASalesVehicle(vehicleid)) { format(string,sizeof(string),"You are entering to a %s (%d) Owner: Dealership",vehicle, vehicleid); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); FreezePlayer(playerid); //Will Freeze the player //PutPlayerInVehicle(playerid, 0); }
I hope that i have helped
|
Is FreezePlayer(playerid); Actually a Function?
And what the hell is the point in making that function going Freezed, Unfreezed, Freezed? It just does not make sence.
@ Topic
Styler Use:
Код:
TogglePlayerControllable(playerid, 0);
For freeze
And
Код:
TogglePlayerControllable(playerid, 1);
For Un-freeze
Re: how can i -
StyleR - 23.12.2010
i did TogglePlayerControllable(playerid, 0); but it doesnt freeze him
Re: how can i -
Mike_Peterson - 23.12.2010
dragonblaster. it seems to be you're not really fully up-to-date with PAWN.
you can make custom functions. Its easy. i simply made SCM (shortcut of SendClientMessage) because i dont wanna type that all the time.. and still its fully working.