SA-MP Forums Archive
help me pls - 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)
+--- Thread: help me pls (/showthread.php?tid=647257)



help me pls - KyNe - 02.01.2018

Код:
    new szDialog20[1024];
    if(GetVehicleModel(vehicleid) == 447 && PlayerInfo[playerid][Level] >= 1)//if player is pilot then he can drive
    {
        RemovePlayerFromVehicle(playerid);
        GivePlayerMoney(playerid, -50000);
        strcat(szDialog20, "{FF4500}Only admin can use this vehicle [Heavy Vehicle].\n",sizeof(szDialog20));
	    strcat(szDialog20, "{FF4500}If you keep enter this vehicle,you will be charged for 50000$",sizeof(szDialog20));
	    ShowPlayerDialog(playerid,6951,DIALOG_STYLE_MSGBOX,"{FF0000}Warning Messages",szDialog20,"Ok","");
    }
    if(GetVehicleModel(vehicleid) == 520 && PlayerInfo[playerid][Level] >= 1)//if player is pilot then he can drive
    {
        RemovePlayerFromVehicle(playerid);
        GivePlayerMoney(playerid, -50000);
        strcat(szDialog20, "{FF4500}Only admin can use this vehicle [Heavy Vehicle].\n",sizeof(szDialog20));
	    strcat(szDialog20, "{FF4500}If you keep enter this vehicle,you will be charged for 50000$",sizeof(szDialog20));
	    ShowPlayerDialog(playerid,6951,DIALOG_STYLE_MSGBOX,"{FF0000}Warning Messages",szDialog20,"Ok","");
    }
    if(GetVehicleModel(vehicleid) == 425 && PlayerInfo[playerid][Level] >= 1)//if player is pilot then he can drive
    {
        RemovePlayerFromVehicle(playerid);
        GivePlayerMoney(playerid, -50000);
        strcat(szDialog20, "{FF4500}Only admin can use this vehicle [Heavy Vehicle].\n",sizeof(szDialog20));
	    strcat(szDialog20, "{FF4500}If you keep enter this vehicle,you will be charged for 50000$",sizeof(szDialog20));
	    ShowPlayerDialog(playerid,6951,DIALOG_STYLE_MSGBOX,"{FF0000}Warning Messages",szDialog20,"Ok","");
    }
    if(GetVehicleModel(vehicleid) == 432 && PlayerInfo[playerid][Level] >= 1)//if player is pilot then he can drive
    {
        RemovePlayerFromVehicle(playerid);
        GivePlayerMoney(playerid, -50000);
        strcat(szDialog20, "{FF4500}Only admin can use this vehicle [Heavy Vehicle].\n",sizeof(szDialog20));
	    strcat(szDialog20, "{FF4500}If you keep enter this vehicle,you will be charged for 50000$",sizeof(szDialog20));
	    ShowPlayerDialog(playerid,6951,DIALOG_STYLE_MSGBOX,"{FF0000}Warning Messages",szDialog20,"Ok","");
    }
it wont remove player when i spawn or enter vehicle


Re: help me pls - Kane - 02.01.2018

RemovePlayerFromVehicle doesn't work with OnPlayerEnterVehicle.

The callback is called when the player begins to enter - not when they're in it. Use ClearAnimation(playerid).


Re: help me pls - KyNe - 02.01.2018

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
RemovePlayerFromVehicle doesn't work with OnPlayerEnterVehicle.

The callback is called when the player begins to enter - not when they're in it. Use ClearAnimation(playerid).
how to make it?
i tried,and get alot of error


Re: help me pls - Kane - 02.01.2018

Show what you did.


Re: help me pls - KyNe - 02.01.2018

Код:
    
	if (newstate==PLAYER_STATE_DRIVER)
		new vehicleid = GetPlayerVehicleID(playerid);
		if(GetVehicleModel(vehicleid) == 447 && PlayerInfo[playerid][Level] >= 1)//if player is pilot then he can drive
			if (PlayerInfo[playerid][Level] >= 1) {
		    	GameTextForPlayer(playerid, test, 3000, 4);
				return 1;
			}
			GameTextForPlayer(playerid, test, 3000, 4);
			return 1;
		}
	}
//------------------------
my pawn crashed


Re: help me pls - KyNe - 02.01.2018

Код:
    new szDialog20[1024],vehicleid = GetPlayerVehicleID(playerid);//variable to get vehicle ids;
    if(GetVehicleModel(vehicleid) == 447 && PlayerInfo[playerid][Level] == 0)//if player is pilot then he can drive
    {
        RemovePlayerFromVehicle(playerid);
        GivePlayerMoney(playerid, -50000);
        strcat(szDialog20, "{FF4500}Only admin can use this vehicle [Heavy Vehicle].\n",sizeof(szDialog20));
	    strcat(szDialog20, "{FF4500}If you keep enter this vehicle,you will be charged for 50000$",sizeof(szDialog20));
	    ShowPlayerDialog(playerid,6951,DIALOG_STYLE_MSGBOX,"{FF0000}Warning Messages",szDialog20,"Ok","");
    }
    if(GetVehicleModel(vehicleid) == 520 && PlayerInfo[playerid][Level] == 0)//if player is pilot then he can drive
    {
        RemovePlayerFromVehicle(playerid);
        GivePlayerMoney(playerid, -50000);
        strcat(szDialog20, "{FF4500}Only admin can use this vehicle [Heavy Vehicle].\n",sizeof(szDialog20));
	    strcat(szDialog20, "{FF4500}If you keep enter this vehicle,you will be charged for 50000$",sizeof(szDialog20));
	    ShowPlayerDialog(playerid,6951,DIALOG_STYLE_MSGBOX,"{FF0000}Warning Messages",szDialog20,"Ok","");
    }
    if(GetVehicleModel(vehicleid) == 425 && PlayerInfo[playerid][Level] == 0)//if player is pilot then he can drive
    {
        RemovePlayerFromVehicle(playerid);
        GivePlayerMoney(playerid, -50000);
        strcat(szDialog20, "{FF4500}Only admin can use this vehicle [Heavy Vehicle].\n",sizeof(szDialog20));
	    strcat(szDialog20, "{FF4500}If you keep enter this vehicle,you will be charged for 50000$",sizeof(szDialog20));
	    ShowPlayerDialog(playerid,6951,DIALOG_STYLE_MSGBOX,"{FF0000}Warning Messages",szDialog20,"Ok","");
    }
    if(GetVehicleModel(vehicleid) == 432 && PlayerInfo[playerid][Level] == 0)//if player is pilot then he can drive
    {
        RemovePlayerFromVehicle(playerid);
        GivePlayerMoney(playerid, -50000);
        strcat(szDialog20, "{FF4500}Only admin can use this vehicle [Heavy Vehicle].\n",sizeof(szDialog20));
	    strcat(szDialog20, "{FF4500}If you keep enter this vehicle,you will be charged for 50000$",sizeof(szDialog20));
	    ShowPlayerDialog(playerid,6951,DIALOG_STYLE_MSGBOX,"{FF0000}Warning Messages",szDialog20,"Ok","");
    }
yeah,but it removed player when he not an admin
but,that dialog appear when we enter hydra,rhino,seasparrow and hydra