[HELP] PlayerScore & Vehicule
#1

If the player score = 1 then he can enter in a taxi(just an example) What code i need for that? i tried a lot of things but it doesn't work....


Srry for my english. Tell me if you need more information.
Reply
#2

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(GetPlayerScore(playerid) < 1) 
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		new modelid = GetVehicleModel(vehicleid);
		if(newkeys == 2 || newkeys == 3)
		{
  		if(modelid == 420) // 420 is the taxi model
			{
				RemovePlayerFromVehicle(playerid);
				SendClientMessage(playerid,0xFF9900AA, "You Don't Have 1 Score To Get In A Taxi");
			}
		}
	}
return 1;
}
that will make if a player doesnt have score 1 or plus he get removed from the taxi
________
SOUTH AMERICAN RECIPES
Reply
#3

it doesn't work.. nothing happen when i enter a taxi...
Reply
#4

maybe put this

GetPlayerScrore(killerid, 1);
GetPlayerScore(playerid, -1);

put that under onplayerdeath .. and i think it will work.
Reply
#5

MrIncredible he doesnt mean to make player lose score when he die , he mean of player score is above 1 he can get in taxi if lower , he get ejected from taxi
________
HERBAL VAPORIZER
Reply
#6

Quote:
Originally Posted by [AC
Etch ]
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(GetPlayerScore(playerid) < 1) 
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		new modelid = GetVehicleModel(vehicleid);
		if(newkeys == 2 || newkeys == 3)
		{
  		if(modelid == 420) // 420 is the taxi model
			{
				RemovePlayerFromVehicle(playerid);
				SendClientMessage(playerid,0xFF9900AA, "You Don't Have 1 Score To Get In A Taxi");
			}
		}
	}
return 1;
}
that will make if a player doesnt have score 1 or plus he get removed from the taxi
OnPlayerKeyStateChange, WHAT?!?!


_________________________________________________


pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 420 && GetPlayerScore(playerid) < 1) // Change 1 To what you want..
    {
        SendClientMessage(playerid, 0xFF0000FF, "You don't have the requiered Score to Use this!");
            new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X,Y,Z);
        SetPlayerPos(playerid, X,Y,Z);
    }
    // more code...
}
or the alternative:


pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicle = GetPlayerVehicleID(playerid));
    if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(vehicle) == 420)
    {
        if(GetPlayerScore(playerid) < 1) return SendClientMessage(playerid, 0xFF0000FF, "You don't have the necessary Score to use this");
    }
    // more code
}

Reply
#7

Quote:
Originally Posted by [AC
Etch ]
MrIncredible he doesnt mean to make player lose score when he die , he mean of player score is above 1 he can get in taxi if lower , he get ejected from taxi
i know but .. let hi m try once because to ur script u said that GetPlayerScore >1
so on player death he has to put it .. i am new in scripting ...
Reply
#8

Quote:
Originally Posted by CueЯvo
Quote:
Originally Posted by [AC
Etch ]
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(GetPlayerScore(playerid) < 1) 
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		new modelid = GetVehicleModel(vehicleid);
		if(newkeys == 2 || newkeys == 3)
		{
  		if(modelid == 420) // 420 is the taxi model
			{
				RemovePlayerFromVehicle(playerid);
				SendClientMessage(playerid,0xFF9900AA, "You Don't Have 1 Score To Get In A Taxi");
			}
		}
	}
return 1;
}
that will make if a player doesnt have score 1 or plus he get removed from the taxi
OnPlayerKeyStateChange, WHAT?!?!


_________________________________________________


pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 420 && GetPlayerScore(playerid) < 1) // Change 1 To what you want..
    {
        SendClientMessage(playerid, 0xFF0000FF, "You don't have the requiered Score to Use this!");
            new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X,Y,Z);
        SetPlayerPos(playerid, X,Y,Z);
    }
    // more code...
}
or the alternative:


pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicle = GetPlayerVehicleID(playerid));
    if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(vehicle) == 420)
    {
        if(GetPlayerScore(playerid) < 1) return SendClientMessage(playerid, 0xFF0000FF, "You don't have the necessary Score to use this");
    }
    // more code
}

Thank you ! it work great!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)