how can i
#1

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);
Reply
#2

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
Reply
#3

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
Reply
#4

i did TogglePlayerControllable(playerid, 0); but it doesnt freeze him
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)