stock CarLevel(vehicleid)
{
if (vehicleid == 411) Level = 10;
}
format(string, sizeof(string), "Level:%i",CarLevel(vehicleid);//how to make that it will tipe the level who I tipe in stock
stock CarLevel(vehicleid)
{
if(vehicleid == 411) return 10;
return 0;
}
format(string, sizeof(string), "Level:%i", CarLevel(vehicleid));
You have to return the number to do that.
pawn Код:
pawn Код:
|
if(GetVehicleModel(vehicle) == 411) return 10;
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
stock CarLevel(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 411) return 10;
if(GetVehicleModel(vehicleid) == 451) return 2;
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
TextDrawShowForPlayer(playerid, carname);
new string[1000];
format(string, sizeof(string), "Car Name:%s~n~Max Speed:240~n~Level:%d", VehicleName[GetVehicleModel(vehicleid) - 400]),CarLevel(playerid);
TextDrawSetString(carname,string);
return 1;
}
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if( newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT )
{
TextDrawShowForPlayer(playerid, carname);
new string[64];
format(string, sizeof(string), "Car Name:%s~n~Max Speed:240~n~Level:%d", VehicleName[GetVehicleModel(vehicleid) - 400],CarLevel(playerid));
TextDrawSetString(carname,string);
}
return 1;
}
stock CarLevel(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 411) return 10;
else if(GetVehicleModel(vehicleid) == 451) return 2;
return 0;
}