[HELP] score for enter vehicle needed [HELP] -
Fantje - 27.02.2015
Hiya!
I need help!
You have the script for:
Enter a Rhino only with 1500+ score?
Thanks!
Re: [HELP] score for enter vehicle needed [HELP] -
MikE1990 - 27.02.2015
Код:
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.
Re: [HELP] score for enter vehicle needed [HELP] -
Fantje - 27.02.2015
EDIT: It works! But... Do you have a script, that you get a message if you try to enter it under 1500 + score?
Re: [HELP] score for enter vehicle needed [HELP] -
Finnick - 27.02.2015
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;
Re: [HELP] score for enter vehicle needed [HELP] -
Fantje - 27.02.2015
You can add a line for that the player gets a message when they don't have enough score?
Re: [HELP] score for enter vehicle needed [HELP] -
MikE1990 - 27.02.2015
What message you want to show ?
Re: [HELP] score for enter vehicle needed [HELP] -
Beckett - 27.02.2015
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.
Re: [HELP] score for enter vehicle needed [HELP] -
CalvinC - 27.02.2015
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
Re: [HELP] score for enter vehicle needed [HELP] -
Kyance - 27.02.2015
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.
Respuesta: [HELP] score for enter vehicle needed [HELP] -
alexus - 27.02.2015
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