[HELP] score for enter vehicle needed [HELP]
#1

Hiya!

I need help!

You have the script for:

Enter a Rhino only with 1500+ score?

Thanks!
Reply
#2

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(GetVehicleModel(vehicleid) == 432 && GetPlayerScore(playerid) < 1500)
	{
	    new Float:posx,Float:posy,Float:posz;
	    GetPlayerPos(playerid, posx, posy, posz);
		SetPlayerPos(playerid, posx, posy, posz + 3);
	}
	return 1;
}
Try this code.
Reply
#3

EDIT: It works! But... Do you have a script, that you get a message if you try to enter it under 1500 + score?
Reply
#4

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == Your Vehicles ID && GetPlayerScore(playerid) < Score For Players)
    {
        new Float:pX,Float:pY,Float:pZ;
        GetPlayerPos(playerid, pX,pY,pZ);
       SetPlayerPos(playerid, pX,pY,pZ + 3);
    }
    return 1;
}
Ex :
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 423 && GetPlayerScore(playerid) < 1500)
    {
        new Float:pX,Float:pY,Float:pZ;
        GetPlayerPos(playerid, 11,111,11,111,1111); // this is for your coordinates
        SetPlayerPos(playerid, 22,222,22,222,2222 + 3); // this is for your coordinates
    }
    return 1;
Reply
#5

You can add a line for that the player gets a message when they don't have enough score?
Reply
#6

What message you want to show ?
Reply
#7

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
   
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vehicleid) == 432 && GetPlayerScore(playerid) < 1500)
            new Float:pX,Float:pY,Float:pZ;
        GetPlayerPos(playerid, pX,pY,pZ);
        SetPlayerPos(playerid, pX,pY,pZ + 3);
        SendClientMessage(playerid,-1,"SERVER: You don't have enough score for this vehicle.");
    }
    return 1;
}
OnPlayerEnterVehicle gets called when the player has hit F near the vehicle not when he is inside it.
Reply
#8

Quote:
Originally Posted by Fantje
Посмотреть сообщение
You can add a line for that the player gets a message when they don't have enough score?
https://sampwiki.blast.hk/wiki/SendClientMessage
Reply
#9

Quote:
Originally Posted by Finnick
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == Your Vehicles ID && GetPlayerScore(playerid) < Score For Players)
    {
        new Float:pX,Float:pY,Float:pZ;
        GetPlayerPos(playerid, pX,pY,pZ);
       SetPlayerPos(playerid, pX,pY,pZ + 3);
    }
    return 1;
}
Ex :
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 423 && GetPlayerScore(playerid) < 1500)
    {
        new Float:pX,Float:pY,Float:pZ;
        GetPlayerPos(playerid, 11,111,11,111,1111); // this is for your coordinates
        SetPlayerPos(playerid, 22,222,22,222,2222 + 3); // this is for your coordinates
    }
    return 1;
what the actual frick
MikE1990 already answered, you pretty much copied his code but added random stuff, which won't make the code work.

OT: Just add "SendClientMessage(playerid, -1, "You need at least 1'500 score to use the Rhino!");" under MikE1990's position checks.
Reply
#10

I think is better to block the rhino. Only add this line in OnVehicleStreamIn callback:
Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
	if(GetVehicleModel(vehicleid) == 432 && GetPlayerScore(playerid) < 1500) SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
	return 1;
}
Simple
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)